Back
63/65
Lesson 63
5 min
FMD: Markdown to HTML & PDF
Render polished, deterministic HTML and PDF from Markdown with one binary
Ready to level up?
Mark complete to track your learning progress.
Render polished, deterministic HTML and PDF from Markdown with one binary
Mark complete to track your learning progress.
Turn Markdown into polished HTML and PDF with one binary using Franken Markdown.
fmd (Franken Markdown) is a pure-Rust, zero-dependency rendering engine that converts Markdown into polished HTML and PDF. It needs no headless browser, LaTeX toolchain, or Node runtime; a single binary renders both formats from the same AST.
The HTML output is fully self-contained: inlined CSS, embedded font subsets, data-URI images, and built-in dark mode. The PDF output is tagged and compact, with real typography. Renders are deterministic: the same input produces the same bytes, and SOURCE_DATE_EPOCH is honored for reproducible builds.
Inlined CSS, embedded fonts, data-URI images, dark mode
Knuth-Plass line breaking for book-quality text layout
~16-language syntax highlighting plus Mermaid diagrams
Browser/WASM package renders identically to the CLI
Use fmd for shareable README previews (a single HTML file you can email or upload anywhere), reproducible PDF documentation (same input, same bytes, so signed or archived docs stay verifiable), and CI rendering of docs with machine-readable status output.
# Shareable one-file preview of a READMEfmd README.md --out README.html# Reproducible PDF docs (deterministic with SOURCE_DATE_EPOCH)SOURCE_DATE_EPOCH=0 fmd SPEC.md --to pdf# CI: render each doc to both formats with machine-readable statusfor f in docs/*.md; do fmd render "$f" --to both --json; done