Overview
| Comment: | Start on new markup and renderer |
|---|---|
| Timelines: | family | ancestors | descendants | both | evolve |
| Files: | files | file ages | folders |
| SHA3-256: |
4ac3f95c1671d6eb4ce1d8f34e62c3bb |
| User & Date: | joel on 2022-04-05 19:19:32.694 |
| Other Links: | branch diff | manifest | tags |
Context
|
2022-04-11
| ||
| 18:32 | Shuffle stuff, serialize notes Leaf check-in: cf83a366 user: joel tags: evolve | |
|
2022-04-05
| ||
| 19:19 | Start on new markup and renderer check-in: 4ac3f95c user: joel tags: evolve | |
|
2021-11-28
| ||
| 19:19 | Clean house check-in: 43a06b90 user: joel tags: evolve | |
Changes
Modified articles/what-should-people-do-with-old-journals.poly.pm
from [36b86268]
to [e18f160a].
1 2 3 4 5 6 7 8 |
#lang pollen
◊; Copyright 2019 by Joel Dueck. All Rights Reserved.
◊(define-meta published "2019-04-11")
◊title{What Should People Do With Old Journals?}
| | > > | | | | 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 |
#lang pollen
◊; Copyright 2019 by Joel Dueck. All Rights Reserved.
◊(define-meta published "2019-04-11")
◊title{What Should People Do With Old Journals?}
When I die, I’ll leave behind a lot of ◊pin{journals} and notebooks. These may be of
interest to my immediate family, but they won’t exactly be great leisure reading. The only obvious
choices are to keep them in a box in the attic, or eventually throw them out.
A ◊def{journal} is a collection of personal observations.
There ought to be a third choice. Even the most mundane journal has great value simply because it
contains lots of historical information about current thinking, lifestyle habits, values, and events,
things which change wildly over long time periods.
◊blockquote[#:caption "hi"]{On the receiving end, suppose you inherit your great-grandfather’s journal; he has been dead for
decades and you never knew him personally. If you can find the time, you pore over it for an hour or
two, deciphering the handwriting. You learn some facts about him and how he looked at things. What
happens after that?}
I have an idea that there should be an ◊pin[#:key "archives"]{archive}, a public repository for
things like this. You could send in your great-grandfather’s journal for use by future historians.
They would digitize or transcribe it, analyze it, and tag it with metadata about who wrote it, when
they wrote it, and generally what topics they wrote about. They could allow you to specify that it
must remain private until a specified date, and provide you with a digital copy, or even a nice hard
copy if you wanted to pay a little extra.
This would give researchers a huge resource to draw upon, and allow the full value of old journals
|
| ︙ | ︙ |
Name change
from pollen.rkt
to pollen-old.rkt.
Modified pollen.rkt
from [92b6e46e]
to [295a2ae6].
1 2 | #lang racket/base | | < | < | < < | | < < < < < < | | | < < < < | | < < < | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < | < < < | < < < < < < | | | < | < > | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | < < | < < < < < < < | > | | < < < | < < < < < < | 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 |
#lang racket/base
(require pollen/decode
txexpr
yarn/markup
yarn/string
yarn/tools)
(provide
(all-defined-out)
(all-from-out yarn/markup))
(module+ setup
(provide block-tags)
(define block-tags blocks-elements))
;; Customized paragraph decoder replaces single newlines within paragraphs
;; with single spaces instead of <br> tags. Allows for “semantic line wrapping”.
(define (decode-hardwrapped-paragraphs xs)
(define (no-linebreaks xs)
(decode-linebreaks xs " "))
(decode-paragraphs xs 'paragraph #:linebreak-proc no-linebreaks))
(define (root . elems)
(validate-txexpr `(test ,@elems))
(check-title elems)
`(document ,@(decode-hardwrapped-paragraphs elems)))
(define (check-title elems)
(cond
[(and (not (meta-set? 'title))
((tx-is? 'poetry #:has-attrs 'title) (car elems)))
(set-meta 'title (format "‘~a’" (attr-ref (car elems) 'title)))
(set-meta 'title-supplied? #t)]
[(not (meta-set? 'title))
(set-meta 'title (first-words elems 5))]))
|
Modified yarn-lib/markup.rkt
from [88b1006b]
to [44b41b90].
1 2 3 4 5 | #lang racket/base ; SPDX-License-Identifier: BlueOak-1.0.0 ; This file is licensed under the Blue Oak Model License 1.0.0. | | > < < < < < | < < | | | | < < < < < < < | < | < < < < < < < < < < | < < | | < > > | < < < | < | < | < < | < < < < < < | < < < < | < < < < < < < < < < > < < < < < < < < < < < < < < | < < | < | | < < < > | < | | | < | < < < | | < < < < | < < < < < < | < < < | | < < | < < < < < < < < | < | < < | | < | | < < < < < < < < < < < | | < < | < | | | > | < < < | < | < < < < < < | | | < < < < < | < < < < < < | | | < < < > | | < < < < < < < < | < < < | | < | < | | < < < | < < < < < < < < | < < < < | < < < | < < < | < < < | < | < < < < | < < < < < < | < < > | | | < < | | < < | < < < < < < < < < < < > | | | 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 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 |
#lang racket/base
; SPDX-License-Identifier: BlueOak-1.0.0
; This file is licensed under the Blue Oak Model License 1.0.0.
;; Pollen “tag functions” that return elements of a Yarn AST. This AST can be
;; rendered into HTML or other formats (using, e.g., the yarn/render/html module).
(require pollen/decode
pollen/tag
"index.rkt"
"string.rkt"
"tools.rkt")
(provide (all-defined-out))
;; Yarn AST:
;; (document Block-Contents)
;; Footnote definitions, index entry keys are stored in the metas
;; Block-Content :=
;; (heading #:level Inline-Contents)
;; | (paragraph Inline-Contents)
;; | (thematic-break style)
;; | (codeblock info Inline-Contents)
;; | (blockquote items := (item Block-Contents))
;; | (poetry title style Block-Contents)
;; | (itemization style start Block-Contents)
;; | (dialogue speeches := (speech interlocutor Block-Contents))
;; | (figure source caption)
;; | (margin-note Block-Contents)
;; Inline-Content :=
;; string?
;; | (italic Inline-Contents)
;; | (bold Inline-Contents)
;; | (link destination Inline-Contents)
;; | (monospace Inline-Contents)
;; | (strikethrough Inline-Contents)
;; | (caps Inline-Contents)
;; | (image description source)
;; | (xref type dest-key Inline-Contents)
;; | (footnote-ref label)
;; | line-break
(define blocks-elements
'(heading
paragraph
thematic-break
codeblock
blockquote
poetry
itemization
dialogue
figure
margin-note))
(define inline-elements
'(italic
bold
link
image
xref
footnote-ref
line-break))
(define (title . t) (set-meta 'title t) (set-meta 'title-supplied? #t) "")
(define (section . s) `(heading [[level "2"]] ,@s))
(define (subsection . s) `(heading [[level "3"]] ,@s))
(define (excerpt . e) (set-meta 'excerpt e))
(define (excerpt* . e) (apply excerpt e) `(@ ,@e))
(define (pause [type 'blank]) `(thematic-break ,type)) ; type = blank | mark
(define codeblock (default-tag-function 'codeblock #:info ""))
(define blockquote (default-tag-function 'blockquote)) ; #:caption
(define figure (default-tag-function 'figure))
(define (i . inline) `(italic ,@inline))
(define em i)
(define (b . inline) `(bold ,@inline))
(define (mono . inline) `(monospace ,@inline))
(define (caps . inline) `(caps ,@inline))
(define (strike . inline) `(strikethrough ,@inline))
(define br 'line-break)
(define (link ref . elems) `(link ,ref ,@elems))
(define (url ref URL) (update-metas-subhash 'urls ref URL) "")
(define (xref type elems k)
(define key (or k (normalize-key (->text elems))))
(cons-to-metas-list 'xref-keys key)
`(xref ,type ,key ,@elems))
(define (pin #:key [key #f] . elems) (xref 'idx elems key))
(define (def #:key [key #f] . elems) (xref 'def elems key))
(define (ref #:key [key #f] . elems) (xref 'ref elems key))
(define (fn ref) `(footnote-ref ,ref))
(define (fndef ref . elems) (update-metas-subhash 'footnote-defs ref elems) "")
(define (ol . elems) `(itemization [[start "1"]] ,@elems)) ; #:style
(define (ul . elems) `(itemization ,@elems)) ; #:style
(define (item . blocks) `(item ,@blocks))
(define (dialogue . speeches) `(dialogue ,@speeches))
(define (say interlocutor elems) `(speech ,interlocutor ,@elems))
(define (saylines interlocutor elems)
`(speech ,interlocutor ,@(decode-linebreaks elems 'line-break)))
(define verse (default-tag-function 'poetry)) ; #:title, #:style
|
Added yarn-lib/render/html.rkt version [db6d2a1b].
Added yarn-lib/string.rkt version [73b950a7].
Added yarn-lib/tools.rkt version [349befab].