4 ms·
> I'm pretty sure the author would say that what you end up with is a KeenWrite document. Documents written in KeenWrite can be typeset using tools that alread
by thangalin 3y ago
> I'm pretty sure the author would say that what you end up with is a KeenWrite document.
Documents written in KeenWrite can be typeset using tools that already exist:
* https://pandoc.org/ https://pandoc.org/
* https://yihui.org/knitr/ https://yihui.org/knitr/
* https://github.com/jfisteus/html2xhtml https://github.com/jfisteus/html2xhtml
I've kept compatibility with pandoc (CommonMark) and knitr a priority; I wrote KeenWrite to replace a shell script that was calling out to those software packages. My Typesetting Markdown blog posts dive into that script and programs:
https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/ https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...
Further, KeenWrite only supports plain TeX, which means that the typesetting system can be any software that is TeX-compatible: LaTeX, ConTeXt, LuaTeX, ExTeX, KaTeX, etc.
- gorkish 3y agoYes I was being a bit pedantic as well! :) Seriously though I do like the workflow you've put together with KeenWrite. I have a potential application where it might be a great fit to replace some markdown->pdf workflows I have built. In my case, I use a Front Matter header to pass structured data along with the markdown to generate templated HTML which can then be "typeset" with the extensions provided by HTMLDOC or wkhtmltopdf. Thanks again for posting and replying. Pleased to make your acquaintance.
- 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/