add details

This commit is contained in:
Eric S. Londres 2023-03-28 22:32:13 -04:00
parent 08d8fbaf0b
commit 86b6eb7faa
Signed by: slondr
GPG Key ID: A2D25B4D5CB970E4
1 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,14 @@ Try `make load`, then enter `(white-tiger:start "file-name.gmi")` or `make` then
`white-tiger` is licensed under the GNU Affero General Public License, version 3.0.
## Details
`white-tiger` contains a gemtext parser in about 50 lines of lisp. The parser is backend-agnostic and produces an abstract syntax list which can be used generically to construct emitters for various other formats.
Building an emitter is extremely easy. If your target format has determinisitc relationship between gemtext line type and output formatting then an emitter is probably an 8-line `map` function. A spec-compliant HTML emitter is 10 lines, because HTML has mandatory top-of-document and bottom-of-document content.
Critically, computation of which lines of the source file are in "preformat mode" and which are not happens in the parse step; this information is included in each node of the abstract syntax list, which means a backend emitter can be *purely context-free* in its output of each node. The parser only iterates through the file contents once, but because the ASL has no shared state between nodes an emitter could theoretically run in parallel with an arity of the line count and thus complete in O(1) time (with arity = n).
## Why the name?
I was scrolling through the gemini wikipedia article for inspiration and this phrase popped up.