3 ms·
I use Markdown for all my books, currently. It used to be a custom XML format, but that was really annoying to type even with custom Vim keybindings. I do wish
by beej71 10mo ago
I use Markdown for all my books, currently. It used to be a custom XML format, but that was really annoying to type even with custom Vim keybindings.
I do wish Markdown were more capable, but it's a good lowest common denominator for HTML and PDF. Also Pandoc-flavored markdown is pretty decent.
My current flow is:
Markdown -> preprocess -> pandoc -> HTML
Markdown -> preprocess -> pandoc -> HTML -> page-splitter -> split HTML
Markdown -> preprocess -> pandoc -> LaTeX -> PDF
That last one is slow, and I'm hoping to replace it with Typst, probably:
Markdown -> preprocess -> pandoc -> docbook -> xlstproc -> typst -> PDF
I've tried other things like Sphinx and it's tough to find something that checks all the boxes I need.
In general, though, I'm pretty impressed with Typst. I wrote a test program that takes the XML output from cmark-gfm and converts it to Typst with xsltproc. It produces PDFs in orders of magnitude less time than Pandoc/LaTeX. I use that now for all my casual PDF documents. https://github.com/beejjorgensen/xml2typ https://github.com/beejjorgensen/xml2typ
- erichocean 10mo agoRepo is nice, thanks. Small nit: it would be nice to have included the final PDF output of your tool on `test.md` in the repo.
- emil-lp 10mo agoThat's not a "nit", that's a request, and for someone with the same process, it would be really annoying. There's a reason you don't want generated data under version control.
- erichocean 9mo agoIs a link in the README to an example PDF really too much to ask? I don't think so, but again, it's a nit.
- creata 10mo ago> I'm hoping to replace it with Typst This might be stupid but is there a reason you want to go through docbook and xsltproc instead of setting --pdf-engine=typst?
- beej71 10mo agoYes. Two reasons: 1) More control over the typst output... 2) I didn't know you could do that. :D :D :D I'll check it out--thanks for the pointer!
- beej71 10mo agoLooks like it's getting there, but still needs some work. It's not obeying the book output or number sections. I can probably get the indexing going, though. Measured at 10x faster than LaTeX.