It needs to handle displaying code well as I want to write a technical book.
I've done something similar but I burnt so much time on configuring Pandoc, citations, formulas, and a compilation process, instead of writing the actual book. If you're writing in Markdown, most of this process for you can be done at the end too.
With that said, Pandoc has been great. Gotta dive into some configuration to get things how you want for the finalized PDF, but it's great.
I've wrote a few books (https://kerkour.com/books) with only markdown, https://excalidraw.com and https://figma.com
I've detailed my complete setup and shared the Dockerfile that I use to convert the markdown into ebooks (EPUB, PDF and Kindle) on my blog: https://kerkour.com/book-self-publishing-pandoc
1: https://weasyprint.org/ 2: https://github.com/adewes/beam-up 3: https://pagedjs.org/ 4: https://pandoc.org/
I recently contributed several chapters to a book. Years ago I wrote a book in MS Word. But this time around we used AsciiDoc. RestructuredText is another option.
I used MS Code's AsciiDoc support, and it worked generally great.
You can also use it to make your book a knowledge base.
Check out their docs for an example of what can be achieved.
What I like about it is that its easily extendable. You can write preprocessors to give yourself new features or an entire backend/renderer to render the book differently. I've written a very simple one myself.
https://komsciguy.com/misc/write-a-programming-book-with-mar...
My pipeline went via a custom latex template which unlocks all the formatting power of latex without having to deal with it for the content.
i've wrote custom code for it that i'll share maybe 1 day but not yet.
what i did was use markdown with node.js & wrote a script that all chapters are read from it.
it looks like this:
_book/ chapter1/ pic1.jpg index.md chapter2/ . . . chapter100/
and then it uses princexml with 100 loc of css to output a beautiful pdf.
this should definitely be a saas though. it has massive potential.
And keep each chapter as separate fileā¦
For my sci-fi novel, my character sheet was inside of a spreadsheet. It dawned on me that the character sheet could be replaced with a YAML file and integrated with a Markdown editor. I developed KeenWrite[2] to replace the scripts while allowing me to use interpolated variables and R inside of the prose.
My novel has two separate timelines and I wanted to make sure that dates lined up correctly without having to do the date math manually. I implemented a number date functions in R[3] based around an "anchor" date. As long as all my other dates are relative (in days) to the anchor date, all the math checks out. Possessives and pronouns are also handled in R (meaning I can change a character's gender by changing a single variable, provided I haven't referenced any sex-specific body parts or characteristics).
Also, I wanted a nice-looking PDF file to send to alpha readers (still looking, see profile). For that, I crafted KeenWrite Themes[4] along with a video tutorial series showing how all the software components work together.
On the technical side, Markdown lacks a standard syntax for citations and cross-references. I've written about this at length.[6] If flexmark-java were to get support, then it would help resolve a long-standing issue with KeenWrite.[7]
[1]: https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...
[3]: https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/R/conver...
[4]: https://gitlab.com/DaveJarvis/keenwrite-themes/
[5]: https://www.youtube.com/playlist?list=PLB-WIt1cZYLm1MMx2FBG9...
[6]: https://talk.commonmark.org/t/cross-references-and-citations...