3 ms·
> Thanks again for posting and replying. Pleased to make your acquaintance. Likewise! > I use a Front Matter header to pass structured data The impetus for d
by thangalin 3y ago
> Thanks again for posting and replying. Pleased to make your acquaintance.
Likewise!
> I use a Front Matter header to pass structured data
The impetus for developing that shell script (ergo KeenWrite) was using variables in documents. KeenWrite injects structured, interpolated YAML strings back into documents by replacing Moustache syntax (or `r# ...` syntax for R docs). This means that the same structured data can be reused for multiple documents, allowing for single sources of truth and a clean separation of content from presentation. Also, variables can be used in diagrams.
As for Front Matter, data can be passed in from the command line[1]:
-v metadata.yaml \
--metadata="title={{book.title}}" \
--metadata="author={{book.author}}"
Under the hood, KeenWrite places the metadata inside the intermediate XHTML document as <meta> tags inside the <head>. These are parsed by ConTeXt using an XSLT-like syntax that converts them into TeX instructions[2].
Do post any questions you may have on the discussions forum[3].
[1]: https://github.com/DaveJarvis/keenwrite/blob/main/docs/cmd.md https://github.com/DaveJarvis/keenwrite/blob/main/docs/cmd.m...
[2]: https://github.com/DaveJarvis/keenwrite-themes/blob/main/xhtml/xml-meta.tex https://github.com/DaveJarvis/keenwrite-themes/blob/main/xht...
[3]: https://github.com/DaveJarvis/keenwrite/discussions/ https://github.com/DaveJarvis/keenwrite/discussions/