Open oubiwann opened 10 months ago
These have potential (both for design and re-thinking info architecture):
Hrm. This is going to be tricky:
There is a Rust markdown library that has an alpha version capable of parsing markdown to an AST:
Perhaps it would be possible to override the Zola parser? Get the mdast as a Rust data structure, walk the AST, convert each heading and its content to HTML, put those in Tera variables and make the available to Zola templates?
Yikes, that sounds like a doozy of a project.
Gonna stop poking now, but should be possible to (with a Zola fork):
Page
struct in components/content/src/page.rs
to include a new field like ast
markdown::mdast::Root
and generate a new data structure that uses headings + depthPage
dataI've done a little cleanup of the /learn
page that should help us limp along until a better/cleaner solution is ready.
Moving the longer-term solution for this to the backlog ...
Let's see where the work here goes:
If that pans out, we can switch the LFE site to using poise instead of zola, and we can update the templates to use the markdown AST to do the specialised rendering setups to avoid walls of text from straight markdown ...
Working on a tool that the poise static generator will need in order for all of this to be possible (extracting selective chunks of a parsed Markdown file for rendering in specific locations in a page template).
That tool is here, and I'm making good progress on it :-D
The usage examples in the README are all currently working (v0.1.0, unreleased). I think this tool will be most useful when shell support has landed, which will allow poise to run it in a supervisor and write commands to its stdin
to generate the desired output (thus avoiding the bad pattern of shelling out to the system for every markdown file that needs to be processed).
TailwindCSS has some nice content separators, callouts, etc., than can be used on the following pages to break up the text and make the read experience a little better:
Resources: