Back to articles
I got tired of LaTeX, so I built a zero-config Python CLI to turn Markdown into premium PDFs
How-ToTools

I got tired of LaTeX, so I built a zero-config Python CLI to turn Markdown into premium PDFs

via Dev.toLeonardo Salas

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.md and even extracts your local git config user.name for 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 p

Continue reading on Dev.to

Opens in a new tab

Read Full Article
1 views

Related Articles