typstgenv0.3.0

Overview

What typstgen does, where it stops, and how this documentation is organised.

typstgen compiles an existing .typ file to PDF. The Typst engine runs inside typstgen as a Rust library, so no typst binary has to be installed and no subprocess is started. Where imported templates live is set in a config file, typstgen.toml, instead of being hardcoded.

One crate, three entry points:

  • CLI: typstgen compile input.typ (default cli feature).
  • Rust library: typstgen::compile(path, &config) returns the PDF bytes.
  • Wasm: the wasm feature exports compile, which takes the source and its imports as a JSON virtual filesystem.

Where it stops

typstgen does typstgen does not
Compile one .typ file to one PDF Watch files or compile folders in bulk
Resolve imports against configured template directories Download Typst packages (@preview/…)
Bundle Typst’s fallback fonts, optionally add system and custom fonts Manage clients, numbering or data (that was docgen)
Report Typst errors and warnings with file, line and column Export PNG, SVG or HTML
Pass sys.inputs, enforce PDF/A or PDF/UA, export page ranges Set the PDF identifier or /Creator

How the docs are organised

Every PDF in the showcase was compiled by typstgen from the .typ file shown next to it.

Edit this page on GitHub · Docs for v0.3.0