Plugins Case Study: Mdbook Preprocessors
Key topics
The plugins case study surrounding mdBook preprocessors has sparked a lively debate about the limitations and potential of Markdown-based documentation tools. While some commenters, like klodolph, criticize mdBook's plugin experience, others, such as denysvitali, point out its support for GitHub Flavored Markdown and Mermaid, suggesting that it may be sufficient for certain use cases. As the discussion unfolds, alternative tools like Quarto and glow emerge as potential solutions to mdBook's shortcomings, particularly when it comes to PDF and ePub export. The conversation highlights the ongoing quest for better Markdown rendering and processing capabilities.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
5d
Peak period
11
108-120h
Avg / period
3.5
Key moments
- 01Story posted
Dec 18, 2025 at 7:47 AM EST
20 days ago
Step 01 - 02First comment
Dec 23, 2025 at 12:12 AM EST
5d after posting
Step 02 - 03Peak activity
11 comments in 108-120h
Hottest window of the conversation
Step 03 - 04Latest activity
Dec 26, 2025 at 3:59 AM EST
12 days ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
My current recommendations are MkDocs (material theme), Jekyll, and Docusaurus. Hugo gets a qualified recommendation, and I only recommend mdBook for people who are doing Rust stuff.
Why provide documentation in a format that is so poorly supported by READERS? Or, to respect the chicken-&-egg problem here: Why is there such a shortage of Markdown viewers?
Every time this comes up, respondents always cite this or that EDITOR that has Markdown "preview." NO. We're not editing the documentation; we're just reading it. So why do we have to load the document into an editor and then invoke a "preview" of it? Consider how nonsensical the term "preview" is in that case: What are we "previewing" its appearance in, given the dearth of Markdown readers?
https://github.com/charmbracelet/glow
Personally, I don't think you need more than that for 90% of the documentation, but I'm happy to hear more about your use case.
[1]: https://github.com/orgs/community/discussions/16925
When you sit down to write the filter for the first time, it’s amazing. You’re using a typed IR that’s well documented, a language that catches you when you’re making mistakes, etc. You have to do very little boring grunt work and focus only on what the filter needs to do.
Over time, the filter became feature complete, so I didn’t want to have to touch it anymore. But the library for parsing JSON releases a new version for every new feature in the AST, and the parsing function checks that the version your filter was compiled with is at least as new as the pandoc that produced the JSON. It has to, because if the pandoc is newer, your older filter won’t know how to parse some of the nodes.
But my filter is feature complete, and doesn’t need to look at those nodes or their new fields: needing to upgrade is just toil. But over time, pandoc releases new versions, and I’d need to recompile the filter to build the new version. At that point, also have to deal with library, build tool, OS, or compiler upgrades, all to recompile a filter that should be fine.
Eventually, I switched to Pandoc lua filters, which don’t have this constraint. New versions of Pandoc don’t need me to boop a version number in my filter. If that wasn’t an option, for any future filters I write, I’d write my own JSON parser that only parser as much of the JSON as I needed, leaving the rest untouched. That way it wouldn’t matter if new changes came along—I could even tolerate backwards incompatible changes as long as they didn’t alter the contract of the narrow focus of that one filter!
There are of course other ways to deal with problems like these (protocol buffers, JSON parsing with an option to throw away unrecognized JSON, etc. etc.)
I have not looked at how mdBook plugins handle this. But if I were writing such a plugin, it’s the first thing I’d look at, and be sure to program around.
There's some example code in their docs (fn handle_preprocessing in the no-op preprocessor) which I've actually included in a preprocessor I wrote some time ago. https://rust-lang.github.io/mdBook/for_developers/preprocess...
[1] https://github.com/rust-lang/mdBook/issues/815
[2] https://quarto.org/
For simple HTML docs mdbook is also excellent. I don't know if you could combine these two domains into one tool nicely. To me they're just too different.
although I have made presentations with mdbook using custom written preprocessors and a custom renderer (all of which were extremely crude, but did the job)[1] https://quarto.org/docs/gallery/