go · CLI + library
pretty-converter turns a folder of Markdown into a PDF, EPUB, and Kindle book via headless Chrome
— then audits the result for overflow, broken links, and low-contrast text before you ship.
No LaTeX, no design tools, nothing to install but a binary.
go install github.com/sazardev/go-pretty-converter/cmd/pretty-converter@latest
How it works
01 — Write
.md, .mdx, or even bare .txt — missing frontmatter gets an id/title generated from the filename automatically.
--- id: "[1.0.0]" title: Getting Started --- # Getting Started
02 — Configure
17 built-in themes, custom paper dimensions for print-on-demand, and a cover image — all from one config file.
theme: gruvbox paper: 6x9in cover_image: cover.svg
03 — Ship
Every build runs a quality audit — overflow, broken images, clipped headings — before you ever open the file.
$ pretty-converter build \
--format pdf,epub,kindle
Everything a real book needs
Every feature below ships in the core binary — no plugins, no paid tier.
From clean & minimal to Gruvbox, LaTeX-style academic papers, and government letterhead.
Build all three formats from the same Markdown in a single pass — no separate pipeline to maintain.
6×9in, A5, or exact mm/in dimensions — the sizes real print-on-demand services expect.
Fenced code blocks are highlighted via Chroma, with a palette matched to your theme.
Table of contents and PDF bookmarks are generated straight from your headings.
Every render is checked for overflow, broken images, low-contrast text, and clipped headings — before you are.
<DeepDive>, <Warning>, <Axiom> — or register your own in Go.
watch and serve rebuild on save, with the browser refreshing instantly.
Even a stray .txt file gets folded in — auto-numbered, auto-titled, zero setup.
pretty-converter analyze flags dead links, oversized tables, and skipped heading levels across every format — before you build anything.
go-pretty-converter.yml sets source, theme, and metadata once — build, epub, kindle, check, and analyze all read the same file.
--json output on build/analyze, and meaningful exit codes throughout — --strict promotes warnings to failures for release gates.
The CLI
The whole tool is one binary with a handful of commands — everything below works on Linux, macOS, and Windows.
pretty-converter init my-bookScaffold a book: skeleton MDX + config.pretty-converter analyzeFlag cross-format rendering issues — no Chrome/Calibre needed.pretty-converter buildRender PDF, EPUB, and/or Kindle (--format pdf,epub,kindle).pretty-converter checkValidate source only — no Chrome needed.pretty-converter epubBuild an EPUB 3, no Chrome required.pretty-converter kindleBuild a Kindle MOBI/AZW3 via Calibre's ebook-convert.pretty-converter serveLive HTML preview with live reload.pretty-converter watchRebuild the PDF on every save.pretty-converter theme listBrowse 17 built-in themes or add your own.pretty-converter completionShell completions for bash, zsh, fish.Themes — try one
This page is skinned with the exact same tokens as the real themes — click one, the whole site follows.
Currently previewing default — this is exactly what your book's cover, headings, and code blocks would use. Download this page's docs in this theme →
The comparison
| LaTeX | Other MD→PDF tools | pretty-converter | |
|---|---|---|---|
| Automatic quality audit (overflow, contrast, broken links) | — | — | Yes |
| PDF + EPUB + Kindle from one source | — | Rarely all three | Yes |
| Runs headless in CI | Yes | Varies | Yes |
| Learning curve | Steep | Varies by tool | Just Markdown |
| Print-ready trim sizes | Manual | Rare | Built in |
| Free & open source | Yes | Mostly | MIT licensed |
Measured, not estimated
Real books rendered end-to-end: parse, validate, compose, Chrome print, and the quality audit are all inside the wall time. Reproducible on your own machine — full methodology and every size in BENCHMARKS.md.
| Source docs | Validation | EPUB | PDF pages | PDF wall time | Throughput |
|---|---|---|---|---|---|
| 100 | 30 ms | 27 ms | 121 | 0.57 s | 211 pages/s |
| 1,000 | 62 ms | 88 ms | 1,180 | 2.99 s | 394 pages/s |
| 3,000 | 142 ms | 248 ms | 3,535 | 23.02 s | 154 pages/s |
FAQ
Straight answers about how go-pretty-converter works, what it needs, and what it can build.
No. PDFs are rendered from Markdown/MDX via headless Chrome — no LaTeX, no separate design tool, nothing to install but the binary.
The quality audit. Most Markdown→PDF tools convert and stop; go-pretty-converter converts, then automatically checks the result for overflow, broken links, low-contrast text, and clipped headings — before you ever open the file. Pair that with one Markdown source building PDF, EPUB, and Kindle alike, and it's the only toolchain in the category that does all three.
Usually not. On first render, chromemgr auto-downloads a headless Chrome build if no system Chrome or --chrome-path is found. Only on linux/arm64 you must provide Chrome yourself.
Yes. The epub command builds EPUB 3 output from the same Markdown with no Chrome or Chromium required.
No. pretty-converter kindle builds the same EPUB with no Chrome required, then converts it to MOBI/AZW3 with Calibre's ebook-convert — install Calibre separately and it's picked up from PATH, or point --calibre-path at it.
.md, .mdx, and even bare .txt files. Documents are ordered by their [X.Y.Z] frontmatter id, not by filename.
17 themes — from minimal and modern to Gruvbox, LaTeX-style academic, corporate, and government letterhead — plus a custom .theme.yml system and per-theme color/font overrides.
Yes. A single command (--format pdf,epub,kindle) builds all three from the same Markdown in one pass — no separate pipeline to maintain.
pretty-converter analyze check?Content patterns that render poorly across formats — broken internal links, missing local images, tables too wide for Kindle, skipped heading levels, overlong code lines, and more — graded as errors, warnings, or improvements. It runs statically, before any build, with no Chrome or Calibre required.
Yes. A 3,000-document book validates in 142 ms and renders a 3,535-page PDF in ~23 s on a mid-range i5. The Go-side pipeline stays sub-second at every size — see BENCHMARKS.md for the reproducible methodology.
Yes — MIT licensed, open source, no paid tier. Every feature ships in the core binary.