html-is-a-tree

28 points by matklad


veqq

As a heads up to the author, janet-html permits precisely the same hiccup (but you don't need ' before). The implementation is perhaps less elegant, but it's more standards compliant with doctype versions and replaces e.g. & etc. besides handling text. Here is an more extensive example. You'd just need to spit the result to a file.

I found this hiccup SSG also: https://github.com/swlkr/speakeasy

jfred

This feels a lot like what Dave Thompson's Haunt does. My own website/blog uses it, and it's quite nice. The page/post/etc templates are functions that return SXML, and you insert the page body structurally into the template: https://git.sr.ht/~jfred/website/tree/master/item/theme.scm#L65

You can write your posts in Skribe: https://git.sr.ht/~jfred/website/tree/master/item/posts/weve-got-you.skr

...or in Markdown: https://git.sr.ht/~jfred/website/blob/master/posts/structural-scheme.md

Or in whatever other format you want, if you write a reader for it. A reader is just a function that turns the input into an SXML tree.

It's very flexible, and I've had a lot of fun using it. :)