Index: code-docs/pollen.scrbl ================================================================== --- code-docs/pollen.scrbl +++ code-docs/pollen.scrbl @@ -163,10 +163,27 @@ The @code{fndef} for a given id may be placed anywhere in the source document, even before it is referenced. If you create a @code{fn} reference without a corresponding @code{fndef}, 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?])] + +Use these two tags together for transcripts of dialogue, chats, screenplays, interviews and so +forth. + +Example usage: + +@codeblock|{ + #lang pollen + + ◊dialogue{ + ◊say["Tavi"]{You also write fiction, or you used to. Do you still?} + ◊say["Lorde"]{The thing is, when I write now, it comes out as songs.} + } +}| @defproc[(note [#:date date-str non-empty-string?] [#:author author string? ""] [#:author-url author-url string? ""] [#:disposition disp-str string? ""]) txexpr?] Index: pollen.rkt ================================================================== --- pollen.rkt +++ pollen.rkt @@ -102,10 +102,12 @@ (poly-branch-tag smallcaps) (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-kwargs-tag blockcode) (poly-branch-kwargs-tag verse) ; [#:title ""] [#:italic "no"] (poly-branch-tag link) (poly-branch-tag url) Index: tags-html.rkt ================================================================== --- tags-html.rkt +++ tags-html.rkt @@ -74,10 +74,12 @@ html-newthought html-smallcaps html-center html-block html-blockcode + html-dialogue + html-say html-verse html-link html-url html-fn html-fndef @@ -87,10 +89,11 @@ (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 "smallcaps")) (define html-center (default-tag-function 'div #:style "text-align: center")) +(define html-dialogue (default-tag-function 'dl #:class "dialogue")) (define (html-block . elements) `(section [[class "content-block"]] (div [[class "content-block-main"]] ,@elements))) (define (html-root . elements) @@ -110,10 +113,13 @@ (define file (or (assoc 'filename attrs) "")) (define codeblock `(pre [[class "code"]] (code ,@elems))) (cond [(string>? file "") `(@ (div [[class "listing-filename"]] 128196 " " ,file) ,codeblock)] [else codeblock])) +(define (html-say . elems) + `(@ (dt ,(car elems)) (dd ,@(cdr 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"])])]