Imprint — branded PDFs from Markdown, with Typst as the engine

I built imprint, a small CLI that turns a Markdown file into a branded, typeset PDF — the kind of spec / design-doc / report that needs to look official. Typst is the typesetting backend (via pandoc -t typst → a custom Typst template → typst compile), and moving off a LaTeX-based approach is what made it fast and genuinely reproducible.

What it does:

  • Reusable house style — set your accent, fonts, and logo once in a config file; every document inherits it. Keep one config per org as a profile and switch with --profile. A document overrides only what it needs in its front matter.
  • Cover or masthead, a running header/footer, an optional gradient cover, block-quote callouts, and ```mermaid blocks rendered to SVG figures.
  • Deterministic — fonts are bundled and embedded, --ignore-system-fonts so the machine’s fonts can never leak in, and I pin SOURCE_DATE_EPOCH so the PDF timestamp doesn’t drift; same input → same bytes.
  • Optional TOC + heading numbering, both off by default so output stays 1:1 with the source Markdown.

The whole layout lives in one pandoc Typst template (templates/default.typ) — theme tokens derived from a single accent color, show/set rules for headings, code, callouts, tables, figures, and the cover/header/footer.

Repo: https://github.com/gunasekar/imprint

I’d love feedback from this crowd specifically on the Typst template — any idioms I’m missing, anything that would break on edge cases, or cleaner ways to do the derived-accent theming and the cover/masthead switch.