-
It's not marketed as a markdown-to-pdf tool, but I've found that Obsidian (https://obsidian.md) does an excellent job. Just create a new "vault", paste your markdown into a new note, and export to PDF.
-
Civic Auth
Auth in Less Than 5 Minutes. Civic Auth comes with multiple SSO options, optional embedded wallets, and user management — all implemented with just a few lines of code. Start building today.
-
I worked on a [whole 500+ page book][1] in Pandoc that included a bunch of code samples, math, a table of contents with working links and an index. (In hindsight, I wish we had thought about the index from the beginning rather than adding it after the fact.)
What worked well for me: Pandoc with a custom LaTeX template, and a decent amount of inline LaTeX to handle edgecases. We had a LaTeX theme to use from our publisher, but we also needed our own totally separate theme for the free version version of the book.
For one-off things like really long code lines, I found it best to manually figure out how to handle them. Sometimes there was a bit of TeX magic but, more often, I just rewrote or reorganized the code. I see the presentation and structure of code and math snippets as an integral part of how I'm communicating the underlying ideas, so manually changing things around to read better was fundamentally no different from going back and editing prose.
Unfortunately, this also means that the process was relatively hands-on. If you need something ≈completed automated, I expect Pandoc → LaTeX is going to fall a bit short. Edge cases need manual intervention, and it's easy for formatting errors to sneak in—the free version of our book has some formatting mistakes like code bleeding into the margin because I ran out of energy to fix all of them!
[1]: https://github.com/TikhonJelvis/RL-book
-
Have you explore the AST tools yet, like Mdast and the related remark and micromark?
https://github.com/syntax-tree/mdast-util-from-markdown
It might work better if you parse it into an intermediary format first, do whatever processing you need to implement "pages" (not a part of any Markdown dialect I'm familiar with?"), output that to HTML and THEN convert the HTML to PDF.
-
-
-
-
I think Pandoc and Calibre could work for you.
I've worked on PAIP, Paradigms of Artificial Intelligence Programming, and I might be able to help you a bit. It's around 1k pages long. I used Pandoc to generate an epub file, and then Calibre to turn that into a PDF file. I just tried using Pandoc to generate the PDF file directly, and it/LaTeX choked on some Unicode characters.
For internal ebook links, there's a Lua script. You'll have to keep anchors unique across the book for this:
* good: "chapter1#section1_1" and "chapter2#section2_1"
* bad: a "chapter1#section1" and a "chapter2#section1"
WIP: https://github.com/norvig/paip-lisp/pull/195
For line wrapping of code, there's CSS. I first used it over on "Writing an Operating System in 1,000 Lines"; here's the PR: https://github.com/nuta/operating-system-in-1000-lines/pull/...
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
I think Pandoc and Calibre could work for you.
I've worked on PAIP, Paradigms of Artificial Intelligence Programming, and I might be able to help you a bit. It's around 1k pages long. I used Pandoc to generate an epub file, and then Calibre to turn that into a PDF file. I just tried using Pandoc to generate the PDF file directly, and it/LaTeX choked on some Unicode characters.
For internal ebook links, there's a Lua script. You'll have to keep anchors unique across the book for this:
* good: "chapter1#section1_1" and "chapter2#section2_1"
* bad: a "chapter1#section1" and a "chapter2#section1"
WIP: https://github.com/norvig/paip-lisp/pull/195
For line wrapping of code, there's CSS. I first used it over on "Writing an Operating System in 1,000 Lines"; here's the PR: https://github.com/nuta/operating-system-in-1000-lines/pull/...
-
Whoa this is weird timing - just this weekend I did a little exploration of using Svelte to create documents and eventually PDFs.
Its really just a proof of concept at this point, but it might be of interest to you (and others).
Code: https://github.com/dominicdoty/sveltedoc
Rendered: https://sveltedoc.pages.dev/
Writeup: https://www.dominicdoty.com/2025/03/02/sveltedoc/
TLDR -