Overview
Comment: | Merge updates from trunk |
---|---|
Timelines: | family | ancestors | descendants | both | licensing |
Files: | files | file ages | folders |
SHA3-256: |
cf26929b73bb95cded78c3b0b3d4f921 |
User & Date: | joel on 2019-05-19 20:24:06 |
Other Links: | branch diff | manifest | tags |
Context
2019-05-19
| ||
21:50 | Switch all license notices to Blue Oak Leaf check-in: 8db9bae9 user: joel tags: licensing | |
20:24 | Merge updates from trunk check-in: cf26929b user: joel tags: licensing | |
2019-05-15
| ||
01:13 | Add keyword index page, make index links bidirectional (addresses [5daecde7]) check-in: ae6010c0 user: joel tags: trunk | |
2019-04-04
| ||
16:12 | Edits to proposed license check-in: 804afbb2 user: joel tags: licensing | |
Changes
Modified .fossil-settings/ignore-glob from [9123c029] to [2a3c277b].
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 | - + | *.html *.out *.ltx *.aux *.log *.xml *.toc |
Modified LICENSE.md from [7f1785f5] to [37f6caff].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 70 71 72 | - - - + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + - + + + + + + + + - + + - + - - - - - - - - - - - - - - - - - - - - + - - - - + + + |
|
︙ |
Added blog.rkt version [44d9d7ad].
|
Modified code-docs/crystalize.scrbl from [c3a0a528] to [4b2805a4].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 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 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 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 | - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | “Crystalizing” is an extra layer in between docs and templates that destructures the doc and stores it in various pieces in a SQLite cache. Individual articles save chunks of rendered HTML to the cache when their individual pages are rendered. The SQLite cache is then referenced by any page that collects multiple articles and notes together. This is much faster than fetching docs and metas through Pollen’s cache and re-converting them to HTML. |
Modified code-docs/dust.scrbl from [d396f326] to [f9a0825d].
︙ | |||
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 53 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 | - - + + - + - - + + + - + + + + - + + + + - - + + + + + + + + | @section{Constants} @defthing[default-authorname string? #:value "Joel Dueck"] Used as the default author name for @code{note}s, and (possibly in the future) for articles generally. |
︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 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 | + + + + + + + + + + + + + + | If @code{(current-metas)} has the key @racket['series], and if the corresponding series defines a meta value for @racket['noun-singular], then return it, otherwise return @racket[""]. @defproc[(series-title) string?] If @code{(current-metas)} has the key @racket['series], and if the corresponding series defines a meta value for @racket['title], then return it, otherwise return @racket[""]. @defproc[(invalidate-series) (or/c void? boolean?)] If the current article specifies a @racket['series] meta, and if a corresponding @filepath{.poly.pm} file exists in @racket[series-folder], attempts to “touch” the last-modified timestamp on that file, returning @racket[#t] on success or @racket[#f] on failure. If either precondition is not true, returns @|void-const|. When an article is being rendered, that means the article has changed, and if the article has changed, its series page (if any) should be updated as well. Touching the @filepath{.poly.pm} file for a series page triggers a re-render of that page when running @tt{make web} to rebuild the web content (see @repo-file{makefile}). Only used in one place, @repo-file{tags-html.rkt}. @defproc[(disposition-values [str string?]) any] Given a string @racket[_str], returns two values: the portion of the string coming before the first space, and the rest of the string. @examples[#:eval dust-eval |
︙ |
Modified code-docs/pollen.scrbl from [ea32843d] to [a48aad25].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | + | #lang scribble/manual @; Copyright (c) 2019 Joel Dueck @; @; Copying and distribution of this file, with or without modification, @; are permitted in any medium without royalty provided the copyright @; notice and this notice are preserved. This file is offered as-is, @; without any warranty. @(require "scribble-helpers.rkt") @(require (for-label "../pollen.rkt" "../dust.rkt" "../crystalize.rkt" racket/base racket/contract racket/string txexpr pollen/tag pollen/setup pollen/core |
︙ | |||
110 111 112 113 114 115 116 117 118 119 120 121 122 123 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + + + + + + + + | If you just need small caps without affecting the paragraph, use @code{smallcaps}. @deftogether[(@defproc[(section [element xexpr?] ...) txexpr?] @defproc[(subsection [element xexpr?] ...) txexpr?])] Create second- and third-level headings, respectively. This is counting the article's title as the first-level header (even if the current article has no title). @defproc[(block [element xexpr?] ...) txexpr?] A container for content that should appear grouped together on larger displays. Intended for use in Series pages, where the template is very minimal. You would want output from @racket[listing<>-short/articles] to appear inside a @racket[block], but you would want output from @racket[listing<>-full/articles] to appear outside it (since each article effectively supplies its own block). Only relevant to HTML output. @deftogether[(@defproc[(link [link-id stringish?] [link-text xexpr?]) txexpr?] @defproc[(url [link-id stringish?] [url string?]) void?])] All hyperlinks are specified reference-style. So, to link some text, use the @code{link} tag with an identifier, which can be a string, symbol or number. Elsewhere in the text, use @code{url} with the same identifier to specify the URL: |
︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | You can refer to a given footnote definition more than once. 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[(index [heading string?] [elements xexpr?] ...) txexpr?] Creates an entry in the keyword index under @racket[_heading] that points back to this spot in the document. If @racket[_elements] is not empty, the web edition of the document will use it as the contents of an understated hyperlink to back to @racket[_heading] in the keyword index. The example below will create two index entries, one under the heading “compassion” and one under the heading “cats”: @codeblock|{ #lang pollen “I have a theory which I suspect is rather immoral,” Smiley went on, more lightly. “Each of us has only a quantum of ◊index["compassion"]{compassion}. That if we lavish our concern on every stray ◊index["cats"] cat we never get to the centre of things. What do you think of it?” }| @defproc[(note [#:date date-str non-empty-string?] [#:author author string? ""] [#:author-url author-url string? ""] [#:disposition disp-str string? ""]) txexpr?] Add a note to the “Further Notes” section of the article. Notes are like blog comments but are |
︙ |
Modified code-docs/scribble-helpers.rkt from [1eef327e] to [73316e54].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 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 | - + + + - - + + + + + + + + + | scribble/manual/lang scribble/html-properties (only-in net/uri-codec uri-encode)) (provide (all-defined-out)) (define repo-url/ "https://thelocalyarn.com/cgi-bin/yarncode/") |
Modified code-docs/snippets-html.scrbl from [d3b4b700] to [80a0bc1d].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | "../dust.rkt" "../snippets-html.rkt" racket/base racket/contract racket/string pollen/template pollen/pagetree txexpr sugar/coerce)) @title{@filepath{snippets-html.rkt}} @defmodule["snippets-html.rkt" #:packages ()] Each “snippet” module provides all the document- and article-level blocks of structural markup |
︙ | |||
53 54 55 56 57 58 59 | 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 | - + + + + - - + + + + + + + + + + + | @section{HTML Snippet functions} @defproc[(html$-page-head [title (or/c string? #f) #f]) non-empty-string?] Returns the @tt{<head>} section of an HTML document. |
︙ | |||
116 117 118 119 120 121 122 123 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | + + + + + + + + + | Like @racket[html$-note-listing-full], but returns HTML for a @racket[note] suitable for display inside its parent article. @defproc[(html$-notes-section [note-htmls string?]) non-empty-string?] Returns the complete HTML for the @italic{Further Notes} section of an article. @defproc[(html$-paginate-navlinks [current-page exact-positive-integer?] [pagecount exact-positive-integer?] [basename string?]) string?] On the “blog”, the articles are split across multiple files: @filepath{blog-pg1.html}, @filepath{blog-pg2.html}, etc. This function provides a string containing HTML for a group of links that can be given within each file, to link to the pages that come before/after it. The links are enclosed within @tt{<li>} tags. It’s up to the calling site to provide the enclosing @tt{<ul>} tag (in case any custom styling or IDs need to be applied). |
Modified crystalize.rkt from [87ac52b6] to [e8e2afa2].
︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 31 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 | + + + + + + + + | ;; since the database is merely a disposable cache, and since all the input ;; will be coming from me. (require pollen/setup pollen/core pollen/template racket/string racket/function txexpr db/base "sqlite-tools.rkt" "snippets-html.rkt" "dust.rkt") ;; ~~~ Provides ~~~ (provide spell-of-summoning! crystalize-article! article-plain-title list/articles list/articles+notes listing<>-short/articles listing<>-full/articles listing<>-full/articles+notes unfence sqltools:dbc preheat-series!) ;; ~~~ Private use ~~~ (define DBFILE (build-path (current-project-root) "vitreous.sqlite")) ;; Since the DB exists to serve as a high-speed cache, the tables are constructed so that |
︙ | |||
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 | 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 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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | + + + + + + + + + + - + - + - + - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | note_id title_html_flow author author_url date disposition content_html series_pagenode listing_full_html listing_excerpt_html ; Not used for now listing_short_html)) (define table_series-fields '(pagenode title published noun_plural noun_singular)) (define table_keywordindex-fields '(entry subentry pagenode anchor)) (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)) (define table_keywordindex (make-table-schema "keywordindex" table_keywordindex-fields #:primary-key-cols '(pagenode anchor))) ;; ~~~ Provided functions: Initializing; Saving posts and notes ;; Initialize the database connection, creating the database if it doesn’t ;; exist, and executing the table schema queries ;; (define (spell-of-summoning!) |
︙ | |||
175 176 177 178 179 180 181 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - + | ;; Convert a bunch of information about an article into some nice English and links. (define (make-article-footertext pagenode series disposition disp-note-id note-count) (define s-title (series-title)) (define s-noun (series-noun)) (define series-part (cond [(non-empty-string? s-title) |
︙ | |||
198 199 200 201 202 203 204 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | - - + + | pagenode note-count)] [(and (note-count . > . 0) (string=? disposition "")) (format "There is <a href=\"/~a#furthernotes\">a note</a> appended." pagenode)] [else ""])) |
︙ | |||
236 237 238 239 240 241 242 | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | - + - + + + + + + + + + + + + + + + + + + + + + + + + | (and ((length (string-split disposition-attr)) . >= . 2))) (raise-arguments-error 'note "must be in format \"[symbol] [past-tense-verb]\"" "disposition attr" disposition-attr)) ;; Parse out remaining columns |
︙ |
Modified dust.rkt from [43f7824f] to [9569787a].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 20 21 22 23 24 25 26 27 28 29 30 31 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 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 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 | + + + + + - + - - + + - - + + - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - | ;; joel@jdueck.net ;; https://joeldueck.com ;; ------------------------------------------------------------------------- (require pollen/core pollen/pagetree pollen/setup pollen/file net/uri-codec file/sha1 gregor txexpr racket/list racket/system racket/string) ;; 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 here-output-path here-id series-noun ; Retrieve noun-singular from current 'series meta, or "" series-title ; Retrieve title of series in current 'series meta, or "" series-pagenode |
︙ | |||
130 131 132 133 134 135 136 | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - - | (define test-attrs '([name "Hazel"] [rank "Chief"])) (parameterize ([current-metas test-metas]) (check-equal? (maybe-meta 'name) "Fiver") ; present meta (check-equal? (maybe-meta 'age) "") ; missing meta (check-equal? (maybe-meta 'age 2) 2)) ; alternate default value |
︙ | |||
221 222 223 224 225 226 227 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | - + | (define (build-note-id txpr) (string-append (maybe-attr 'date (get-attrs txpr)) "_" (uri-encode (maybe-attr 'author (get-attrs txpr) default-authorname)))) ;; Extract the last disposition (if any), and the ID of the disposing note, out of a list of notes (define (notes->last-disposition-values txprs) |
︙ |
Added keyword-index.rkt version [9aa8d227].