Overview
Comment: | Fixes for new use of poly-branch macros |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7bb712ef16687570089285d0a0f36a11 |
User & Date: | joel on 2019-03-16 21:22:37 |
Other Links: | manifest | tags |
Context
2019-03-19
| ||
03:31 | Use a tag instead of metas for title. Use default-title consistently. Refine first-words to be smarter about punctutation. Closes [c055cacb] and fixes [b3ade0b7] check-in: e81b4199 user: joel tags: trunk | |
2019-03-16
| ||
21:22 | Fixes for new use of poly-branch macros check-in: 7bb712ef user: joel tags: trunk | |
20:44 | Clarify poly-branch macro names (resolves [fbbb5ed9]) check-in: 6b60dccb user: joel tags: trunk | |
Changes
Modified code-docs/pollen.scrbl from [3dd46911] to [0a71a786].
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | + + + | @defproc[#:kind "syntax" (poly-branch-kwargs-tag (id symbol?)) (-> txexpr?)] Works just like @racket[poly-branch-tag], but uses Pollen’s @racket[define-tag-function] so that keyword arguments will automatically be parsed as X-expression attributes. Additionally, the branch functions called from the new function must accept exactly two arguments: a list of attributes and a list of elements. @margin-note{The thought behind having two macros so similar is that, by cutting out handling for keyword arguments, @racket[poly-branch-tag] could produce simpler and faster code. I have not verified if this intuition is meaningful or correct.} @section{Markup reference} |
︙ |
Modified pollen.rkt from [c42202f2] to [d257d515].
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - - - + + | (syntax-parse stx [(_ TAG:id) (with-syntax ([((POLY-TARGET POLY-FUNC) ...) (for/list ([target (in-list (setup:poly-targets))]) (list target (format-id stx "~a-~a" target #'TAG)))] [DEFAULT-FUNC (format-id stx "html-~a" #'TAG)]) #'(define-tag-function (TAG attributes elems) |
︙ | |||
97 98 99 100 101 102 103 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + | (poly-branch-tag blockquote) (poly-branch-tag newthought) (poly-branch-tag smallcaps) (poly-branch-tag center) (poly-branch-tag section) (poly-branch-tag subsection) (poly-branch-tag code) |
︙ |
Modified tags-html.rkt from [12093157] to [a6c4e837].
︙ | |||
85 86 87 88 89 90 91 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - + - + - + | (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 "smallcaps")) (define html-center (default-tag-function 'div #:style "text-align: center")) |
︙ | |||
187 188 189 190 191 192 193 | 187 188 189 190 191 192 193 194 195 | - + | `(a [[href ,(string-append "#" (fn-id fn-name) (format "~a" (+ 1 fnref-num)))]] "↩"))]) `(li [[id ,(fndef-id fn-name)]] ,@definition-text ,@backrefs)))) (cond [(null? note-items) ""] [else `(section ((class "footnotes")) (hr) (ol ,@note-items))])) |