54017d1fc5
continuous-integration/drone/push Build is passing
Details
|
||
---|---|---|
src | ||
.drone.yml | ||
.gitignore | ||
LICENSE.md | ||
Makefile | ||
README.md | ||
design.org | ||
white-tiger.asd |
README.md
white-tiger
white-tiger
is a gemtext parser written in Common Lisp.
It has no dependencies except for a Common Lisp implementation and the ASDF build system.
The makefile includes some sbcl
-based scripts for loading an interpreter with the package loaded or compiling a native binary.
Try make load
, then enter (white-tiger:start "file-name.gmi")
or make
then ./white-tiger file-name.gmi
.
License
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).
See the "design" file for more details on the implementation, including the type format for nodes and the list production.
Why the name?
I was scrolling through the gemini wikipedia article for inspiration and this phrase popped up.