Index: code-docs/pollen.scrbl ================================================================== --- code-docs/pollen.scrbl +++ code-docs/pollen.scrbl @@ -177,14 +177,16 @@ a @code{"Missing footnote definition!"} message will be substituted for the footnote text. Conversely, creating a @code{fndef} that is never referenced will produce no output, warning or error. @deftogether[(@defproc[(dialogue [elements xexpr?] ...) txexpr?] - @defproc[(say [interlocutor string?] [elements xexpr?] ...) txexpr?])] + @defproc[(say [interlocutor string?] [elements xexpr?] ...) txexpr?] + @defproc[(saylines [interlocutor string?] [elements xexpr?] ...) txexpr?])] -Use these two tags together for transcripts of dialogue, chats, screenplays, interviews and so -forth. +Use these tags together for transcripts of dialogue, chats, screenplays, interviews and so +forth. The @racket[saylines] tag is the same as @racket[say] except that within @racket[saylines], +linebreaks within paragraphs are preserved. Example usage: @codeblock|{ #lang pollen @@ -273,11 +275,11 @@ @defproc[(strike [element xexpr?] ...) txexpr?] @defproc[(ol [element xexpr?] ...) txexpr?] @defproc[(ul [element xexpr?] ...) txexpr?] @defproc[(item [element xexpr?] ...) txexpr?] @defproc[(sup [element xexpr?] ...) txexpr?] - @defproc[(smallcaps [element xexpr?] ...) txexpr?] + @defproc[(caps [element xexpr?] ...) txexpr?] @defproc[(code [element xexpr?] ...) txexpr?])] Work pretty much how you’d expect. @section{Convenience macros} Index: pollen.rkt ================================================================== --- pollen.rkt +++ pollen.rkt @@ -87,17 +87,18 @@ (poly-branch-tag ul) (poly-branch-tag item) (poly-branch-tag sup) (poly-branch-tag blockquote) (poly-branch-tag newthought) -(poly-branch-tag smallcaps) +(poly-branch-tag caps) (poly-branch-tag center) (poly-branch-tag section) (poly-branch-tag subsection) (poly-branch-tag code) (poly-branch-tag dialogue) (poly-branch-tag say) +(poly-branch-tag saylines) (poly-branch-kwargs-tag index) (poly-branch-tag figure) (poly-branch-tag figure-@2x) (poly-branch-tag image-link) (poly-branch-kwargs-tag blockcode) Index: tags-html.rkt ================================================================== --- tags-html.rkt +++ tags-html.rkt @@ -55,11 +55,11 @@ (provide html-root html-item html-section html-subsection html-newthought - html-smallcaps + html-caps html-center html-strike html-block html-blockcode html-index @@ -66,10 +66,11 @@ html-figure html-figure-@2x html-image-link html-dialogue html-say + html-saylines html-verse html-link html-url html-fn html-fndef @@ -77,11 +78,11 @@ (define html-item (default-tag-function 'li)) (define html-section (default-tag-function 'h2)) (define html-subsection (default-tag-function 'h3)) (define html-newthought (default-tag-function 'span #:class "newthought")) -(define html-smallcaps (default-tag-function 'span #:class "caps")) +(define html-caps (default-tag-function 'span #:class "caps")) (define html-center (default-tag-function 'div #:style "text-align: center")) (define html-strike (default-tag-function 'span #:style "text-decoration: line-through")) (define html-dialogue (default-tag-function 'dl #:class "dialogue")) (define (html-block . elements) @@ -112,13 +113,18 @@ [href ,(string-append "/keyword-index.html#" (uri-encode (string-downcase index-key)))] [data-index-entry ,index-key] [class "index-link"]] ,@elems)) +;; To be used within ◊dialogue (define (html-say . elems) `(@ (dt ,(car elems) (span [[class "x"]] ": ")) (dd ,@(cdr elems)))) +;; Same as ◊say, but preserve linebreaks +(define (html-saylines . elems) + (apply html-say (decode-linebreaks elems))) + (define (html-verse attrs elems) (let* ([title (maybe-attr 'title attrs "")] [italic? (assoc 'italic attrs)] [pre-attrs (cond [italic? '([class "verse"] [style "font-style: italic"])] [else '([class "verse"])])]