News for hackers. Stuff that matters.
Re:Pandoc by pronoiac on Friday February 02, 2024 @04:14PM (#39234498)
My opinions: * write in Pandoc Markdown. * give each sentence its own line. It helps with composing and reordering, and gives much cleaner diffs if you keep this in a git repo. * personally, I used GitHub for html, Pandoc to make the epub, then Calibre to turn the epub into a pdf.

The "internal links" thing is a pain, admittedly. I have an idea for a workaround:

* sprinkle hidden, unique <a id="ch1.2"></a> around

* on GitHub, use links like chapter1#ch1.2

* for Pandoc, preprocess to remove the filename before the #

I'm working with a big enough book that it's an undertaking, so I haven't done this yet.

Re:Pandoc by uneekname on Friday February 02, 2024 @04:47PM (#39234916)
Interesting idea re:internal links. For sufficiently complex issues of this nature, pandoc filters[0] are a powerful tool for this kind of mid-conversion processing. I've made some cool projects with the Python package panflute[1]

[0] https://pandoc.org/filters.html

[1] https://github.com/sergiocorreia/panflute