Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Single-Binary Markdown-to-PDF CLI in Rust, Powered by Typst (MDXport) (github.com/cosformula)
3 points by ZacharyZZ 66 days ago | hide | past | favorite
I wanted a fast way to turn Markdown files into good-looking PDFs from the terminal. Pandoc + LaTeX is powerful but heavy. Browser-based tools break my workflow. So I built mdxport: one binary, no dependencies, pipe in Markdown, get a PDF.

Under the hood it parses Markdown with comrak, converts to Typst, and compiles to PDF in-process. No LaTeX installation, no network calls, no temp files flying around.

What it handles: LaTeX math ($E=mc^2$, display blocks), GFM tables, fenced code blocks, YAML frontmatter (title/author/lang/toc), and two built-in templates. You can also pass your own .typ template.

CJK support was a pain point I wanted to solve properly. mdxport fonts install downloads Noto CJK fonts, and the converter auto-detects CJK characters and warns if fonts are missing. Chinese/Japanese/Korean documents just work.

Watch mode (mdxport input.md -w) recompiles on save. Stdin works too: cat notes.md | mdxport -o notes.pdf.

Install: npm install -g @mdxport/cli (ships platform-specific binaries, no Rust toolchain needed) or cargo install mdxport.

https://github.com/cosformula/mdxport-cli (MIT, Rust, 55 tests, CI builds for macOS/Linux/Windows)

There's also a web version at https://mdxport.com if you prefer a browser UI.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: