Have you ever just wanted to turn your standard README.md into a nice, academic-looking PDF without having to install a 2GB LaTeX environment or write a 500-line config file? Same here.
I was tired of dealing with complex setups just to export some documentation, so I built a pure Python solution: doc-engine-cli.
How it works under the hood
I used mistune to parse the Markdown AST natively and safely in memory. Then, instead of hooking it up to a classic HTML-to-PDF engine (which usually misplaces margins and page breaks), I routed the parsed blocks directly into the lightning-fast Typst compiler engine via its python bindings.
The result:
-
Zero friction: It automatically detects your
README.mdand even extracts your localgit config user.namefor the cover page metadata. - Premium Typography: I shipped it with default Inter (sans-serif) and Cascadia Code typography to make code blocks look beautiful.
- Smart elements: Dynamic Table of Contents, syntax-highlighted code fences, and proper page breaks out of the box.
Try it out!
You can install it instantly and securely via pipx:
pipx install doc-engine-cli
And just run
doc-engine build --open
in any folder with a markdown file.
If you don't even want Python installed, I've also containerized it on GHCR:
docker run --rm -v ${PWD}:/workspace ghcr.io/leonardosalasd/doc-engine-cli:main
I'd absolutely love to hear your feedback, bug reports, or feature requests.
- 🐙 GitHub: leonardosalasd/doc-engine-cli
- 📦 PyPI: doc-engine-cli on PyPI
Let me know what you think of the Typst integration!

Top comments (0)