Local Yarn Code

Check-in [374734ed]
Overview
Comment:Rename smallcaps→caps, add saylines tag
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 374734edadbc8fdbe1d4cea8612f405d423e84c2d2fa5263412bb6c65c4b6471
User & Date: joel on 2019-06-20 01:17:17
Other Links: manifest | tags
Context
2019-06-23
16:40
Fix verse italic attribute to match docs check-in: d42e2609 user: joel tags: trunk
2019-06-20
01:17
Rename smallcaps→caps, add saylines tag check-in: 374734ed user: joel tags: trunk
01:16
Add space between list items (CSS) check-in: 3912ae79 user: joel tags: trunk
Changes

Modified code-docs/pollen.scrbl from [9c115120] to [c9accf05].

   175    175   The @code{fndef} for a given id may be placed anywhere in the source document, even before it is
   176    176   referenced. If you create a @code{fn} reference without a corresponding @code{fndef},
   177    177   a @code{"Missing footnote definition!"} message will be substituted for the footnote text.
   178    178   Conversely, creating a @code{fndef} that is never referenced will produce no output, warning or
   179    179   error.
   180    180   
   181    181   @deftogether[(@defproc[(dialogue [elements xexpr?] ...) txexpr?]
   182         -              @defproc[(say [interlocutor string?] [elements xexpr?] ...) txexpr?])]
          182  +              @defproc[(say [interlocutor string?] [elements xexpr?] ...) txexpr?]
          183  +              @defproc[(saylines [interlocutor string?] [elements xexpr?] ...) txexpr?])]
   183    184   
   184         -Use these two tags together for transcripts of dialogue, chats, screenplays, interviews and so
   185         -forth.
          185  +Use these tags together for transcripts of dialogue, chats, screenplays, interviews and so
          186  +forth. The @racket[saylines] tag is the same as @racket[say] except that within @racket[saylines],
          187  +linebreaks within paragraphs are preserved.
   186    188   
   187    189   Example usage:
   188    190   
   189    191   @codeblock|{
   190    192     #lang pollen
   191    193   
   192    194     ◊dialogue{
................................................................................
   271    273                 @defproc[(b      [element xexpr?] ...) txexpr?]
   272    274                 @defproc[(strong [element xexpr?] ...) txexpr?]
   273    275                 @defproc[(strike [element xexpr?] ...) txexpr?]
   274    276                 @defproc[(ol     [element xexpr?] ...) txexpr?]
   275    277                 @defproc[(ul     [element xexpr?] ...) txexpr?]
   276    278                 @defproc[(item   [element xexpr?] ...) txexpr?]
   277    279                 @defproc[(sup    [element xexpr?] ...) txexpr?]
   278         -              @defproc[(smallcaps [element xexpr?] ...) txexpr?]
          280  +              @defproc[(caps   [element xexpr?] ...) txexpr?]
   279    281                 @defproc[(code   [element xexpr?] ...) txexpr?])]
   280    282   Work pretty much how you’d expect.
   281    283   
   282    284   @section{Convenience macros}
   283    285   
   284    286   @defform[(for/s thing-id listofthings result-exprs ...)
   285    287            #:contracts ([listofthings (listof any/c)])]

Modified pollen.rkt from [5b4c5fa4] to [cbfc059e].

    85     85   ;(poly-branch-tag color)
    86     86   (poly-branch-tag ol)
    87     87   (poly-branch-tag ul)
    88     88   (poly-branch-tag item)
    89     89   (poly-branch-tag sup)
    90     90   (poly-branch-tag blockquote)
    91     91   (poly-branch-tag newthought)
    92         -(poly-branch-tag smallcaps)
           92  +(poly-branch-tag caps)
    93     93   (poly-branch-tag center)
    94     94   (poly-branch-tag section)
    95     95   (poly-branch-tag subsection)
    96     96   (poly-branch-tag code)
    97     97   (poly-branch-tag dialogue)
    98     98   (poly-branch-tag say)
           99  +(poly-branch-tag saylines)
    99    100   (poly-branch-kwargs-tag index)
   100    101   (poly-branch-tag figure)
   101    102   (poly-branch-tag figure-@2x)
   102    103   (poly-branch-tag image-link)
   103    104   (poly-branch-kwargs-tag blockcode)
   104    105   (poly-branch-kwargs-tag verse)          ; [#:title ""] [#:italic "no"]
   105    106   

Modified tags-html.rkt from [e503dfd4] to [38504446].

    53     53                                     code)
    54     54   
    55     55   (provide html-root
    56     56            html-item
    57     57            html-section
    58     58            html-subsection
    59     59            html-newthought
    60         -         html-smallcaps
           60  +         html-caps
    61     61            html-center
    62     62            html-strike
    63     63            html-block
    64     64            html-blockcode
    65     65            html-index
    66     66            html-figure
    67     67            html-figure-@2x
    68     68            html-image-link
    69     69            html-dialogue
    70     70            html-say
           71  +         html-saylines
    71     72            html-verse
    72     73            html-link
    73     74            html-url
    74     75            html-fn
    75     76            html-fndef
    76     77            html-note)
    77     78   
    78     79   (define html-item (default-tag-function 'li))
    79     80   (define html-section (default-tag-function 'h2))
    80     81   (define html-subsection (default-tag-function 'h3))
    81     82   (define html-newthought (default-tag-function 'span #:class "newthought"))
    82         -(define html-smallcaps (default-tag-function 'span #:class "caps"))
           83  +(define html-caps (default-tag-function 'span #:class "caps"))
    83     84   (define html-center (default-tag-function 'div #:style "text-align: center"))
    84     85   (define html-strike (default-tag-function 'span #:style "text-decoration: line-through"))
    85     86   (define html-dialogue (default-tag-function 'dl #:class "dialogue"))
    86     87   
    87     88   (define (html-block . elements)
    88     89     `(section [[class "content-block"]] (div [[class "content-block-main"]] ,@elements)))
    89     90   
................................................................................
   110    111     (define index-key (maybe-attr 'key attrs (tx-strs `(span ,@elems))))
   111    112     `(a [[id ,(here-id (list "_idx-" (uri-encode index-key)))]
   112    113          [href ,(string-append "/keyword-index.html#" (uri-encode (string-downcase index-key)))]
   113    114          [data-index-entry ,index-key]
   114    115          [class "index-link"]]
   115    116         ,@elems))
   116    117   
          118  +;; To be used within ◊dialogue
   117    119   (define (html-say . elems)
   118    120     `(@ (dt ,(car elems) (span [[class "x"]] ": ")) (dd ,@(cdr elems))))
   119    121   
          122  +;; Same as ◊say, but preserve linebreaks
          123  +(define (html-saylines . elems)
          124  +  (apply html-say (decode-linebreaks elems)))
          125  +
   120    126   (define (html-verse attrs elems)
   121    127     (let* ([title  (maybe-attr 'title attrs "")]
   122    128            [italic? (assoc 'italic attrs)]
   123    129            [pre-attrs (cond [italic? '([class "verse"] [style "font-style: italic"])]
   124    130                             [else '([class "verse"])])]
   125    131            [pre-title (cond [(string>? title "") `(p [[class "verse-heading"]] ,title)]
   126    132                             [else ""])])