Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: