Overview
Comment: | 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] |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e81b4199ad4f49b4797da6e379cca230 |
User & Date: | joel on 2019-03-19 03:31:53 |
Other Links: | manifest | tags |
References
2019-03-19
| ||
03:37 | • Closed ticket [c055cacb]: Use a tag rather than a meta for article title plus 4 other changes artifact: da5cd2ea user: joel | |
Context
2019-03-20
| ||
00:41 | Clean up small errors in code docs. Fixes [3510585b] check-in: 1787e5b0 user: joel tags: trunk | |
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 | |
Changes
Modified code-docs/dust.scrbl from [d66853e3] to [71bc13f3].
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + - + | @(require "scribble-helpers.rkt" scribble/example) @(require (for-label "../pollen.rkt" "../dust.rkt" racket/base racket/contract txexpr sugar/coerce pollen/tag pollen/setup pollen/pagetree pollen/core)) @(define dust-eval (make-base-eval)) |
︙ | |||
71 72 73 74 75 76 77 | 72 73 74 75 76 77 78 79 80 81 82 83 84 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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | - + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + - + + + + + + + + + - + | @defproc[(maybe-meta [key symbolish?] [missing-expr any/c ""]) any/c] Look up a value in @code{(current-metas)} that may or may not be present, returning the value of @racket[_missing-expr] if it’s not there. @defproc[(tx-strs [tx txexpr?]) string?] |
︙ |
Modified code-docs/pollen.scrbl from [0a71a786] to [a5d17272].
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + + + + - - - - + + + + + + + + + + + + | The convention in this project is to define and provide these branch functions in separate files: see, e.g., @filepath{tags-html.rkt}. Functions defined with this macro @emph{do not} accept keyword arguments. If you need keyword arguments, see @racket[poly-branch-kwargs-tag]. @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.} @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. |
︙ |
Modified crystalize.rkt from [2d723137] to [e57a2fd4].
︙ | |||
95 96 97 98 99 100 101 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - - - - - - - - + + + + + + + - - - - - + + + + + + + - - - + + - - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - + - - - + + - - - + + - - + - + - + - - - + - - + | noun_plural noun_singular)) (define table_articles (make-table-schema "articles" table_articles-fields)) (define table_notes (make-table-schema "notes" table_notes-fields #:primary-key-cols '(pagenode note_id))) (define table_series (make-table-schema "series" table_series-fields)) |
︙ |
Modified dust.rkt from [402b4b9e] to [43f7824f].
︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + - - + + | ;; Provides common helper functions used throughout the project (provide maybe-meta ; Select from (current-metas) or default value ("") if not available maybe-attr ; Return an attribute’s value or a default ("") if not available series-noun ; Retrieve noun-singular from current 'series meta, or "" series-title ; Retrieve title of series in current 'series meta, or "" series-pagenode attr-present? ; Test if an attribute is present make-tag-predicate tx-strs ymd->english ymd->dateformat default-authorname default-title articles-path series-path articles-pagetree series-pagetree first-words build-note-id notes->last-disposition-values disposition-values ) (define default-authorname "Joel Dueck") (define series-path "series") (define articles-path "articles") |
︙ | |||
108 109 110 111 112 113 114 115 116 117 118 119 120 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (define (maybe-attr name attrs [missing ""]) (define result (assoc name attrs)) (cond [(pair? result) (cadr result)] [else missing])) ;; Returns a function will test if a txexpr's tag matches the given symbol. (define (make-tag-predicate tagsym) (lambda (tx) (and (txexpr? tx) (equal? tagsym (get-tag tx))))) (define (tx-strs xpr) (cond [(txexpr? xpr) (apply string-append (map tx-strs (get-elements xpr)))] [(string? xpr) xpr] [else ""])) |
︙ |
Modified pollen.rkt from [d257d515] to [4cf3382b].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + + | "snippets-html.rkt" "crystalize.rkt") (provide (all-defined-out) (all-from-out "crystalize.rkt" "snippets-html.rkt")) (module setup racket/base |
︙ |
Modified snippets-html.rkt from [704d9dde] to [fd84a05e].
︙ | |||
52 53 54 55 56 57 58 | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + - + | (define (html$-page-body-open) ◊string-append{<body><main> <a href="/"><header> <img src="/web-extra/logo.png" height="103" width="129" class="logo"> <h1>The Local Yarn</h1> </header></a>}) |
︙ |