All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[v0.1.0] - 2026-12-03
The first release, with Typst 0.15.1. The NIF and the pool's worker are precompiled for macOS (Apple Silicon and Intel), Linux (x86-64 and ARM64, glibc and musl) and Windows (x86-64).
Added
- Document modules with
use Typsty:render/1with the~TYPSTsigil, or a colocated.typtemplate (or one given with the:templateoption), and generatedto_pdf/2,to_png/2andto_svg/2, with bang variants. - Components, with
use Typsty.Component: reusable Typst functions (tables, letterheads, headers and footers), in a.typfile or a~TYPSTsigil.- Documents list them (
use Typsty, components: [...], or the:componentsoption) and import them fromcomponents/<name>.typ, with the components they list. The:nameoption names a component. - They're checked when they compile: their top level can only have
definitions and imports, and they can't read
sys.inputs(or useeval), so they only get data as arguments. Their errors point at the lines of their files, andTypsty.SyntaxErrorhas a:kind(:syntaxor:component). - A component's own files (images, data and
.typfiles) go in a folder next to it (or the one given withfiles:), are kept in its module, and are served atcomponents/<name>/. The paths it reads them from, written as strings, are checked when it compiles. - Documents depend on components at runtime only, so changing one doesn't recompile them.
components/is reserved::filescan't have files there, and it isn't read from:root, so a file in:filescan't take a component's place.
- Documents list them (
Typsty.to_pdf/3,Typsty.to_png/3andTypsty.to_svg/3for templates and Typst source.- The assigns (a map) are passed to the template as a dictionary named
assigns(#assigns.name), as Typst values rather than generated code, so they never shadow anything in Typst: strings, numbers, booleans,nil, lists, tuples, maps (as dictionaries sorted by key), dates and times, decimals,MapSets,Ranges andDate.Ranges. Other structs implementTypsty.Encoder, by deriving it (@derive {Typsty.Encoder, only: [...]}) or implementing it. Using an assign that wasn't given comes with a hint that says so. Imported files other than components can read the assigns fromsys.inputs.assigns. - A virtual file system: images, data files and
.typfiles are passed as binaries with the:filesoption. Files can also be read from a:rootdirectory, which documents can't read outside of, even through symbolic links (unless one is swapped in while a document reads it). - Fonts from the system, from Typst's embedded fonts and from
:font_paths, scanned once per font configuration and cached.Typsty.font_families/1lists the font families and warms the cache. - Typst packages from local
:package_pathsdirectories, andmix typsty.packages.getto download packages from Typst Universe into the project (with the packages they import), as arguments or fromconfig :typsty, packages:, through the HTTP proxy inHTTPS_PROXYorHTTP_PROXY(but for the hosts inNO_PROXY). Rendering never downloads packages, and a missing package's error says how to fetch it and where it looked. Typsty.typst_version/0.- Template syntax checked at compile time, with
Typsty.SyntaxErrorpointing at the line and column in the module or.typfile.Typsty.validate/1checks Typst source at runtime. Typsty.RenderError, with a:reasonthat tells Typst's errors (:typst) from timeouts (:timeout), renders that couldn't start in time (:busy), the pool's memory limit (:memory_limit) and crashes (:crashed), and Typst's diagnostics (message, hints, location and trace), mapped to the lines of the module or.typfile, with the warnings that came before the errors. Typst's warnings are logged.Typsty.Formatter, amix formatplugin for~TYPSTsigils and.typfiles, using typstyle.Typsty.format/2formats Typst source.- PDF standards (such as PDF/A-2b and PDF/UA-1) with the
:pdf_standardsoption, and the PNG resolution with:ppi. - Telemetry events for every render.
- Options checked with NimbleOptions, in calls and in the application config (where unknown keys are typos), with errors that name the option, and option docs and typespecs generated from the same schemas.
Typsty.Pool, a pool of worker processes to render in, with the:pooloption (per render, or in the config), favored for input from untrusted users that isn't well validated. A render that runs past its timeout is stopped right away, renders can be held to a memory limit set for the pool (:memory_limit), and a worker that crashes takes nothing else down. Workers get only the environment variables that finding fonts needs. A pool starts once its workers have started and loaded their fonts, so that the first renders don't wait for them. Workers are replaced when they're stopped, can be recycled after a number of renders (:max_renders), and end with the pool, with the process rendering with them, and with the VM. Renders return what they return in the NIF, and can also read PDF files and SVGs that contain SVGs. The worker program is built from the same code as the NIF, and precompiled downloads include it.- Protection for the VM:
- Renders run on threads of their own with large stacks (as does Typst's
thread pool), so deep recursion can't overflow a scheduler's stack, and
panics become
Typsty.RenderErrors. The process that asked for a render waits for a message, so renders never hold up the VM's schedulers. - Renders time out after 60 seconds by default (
:timeout) and are cancelled, unwinding at their next call into Typst. A render is cancelled too when the process waiting for it exits. At most:max_concurrent_rendersrenders run at once, counting cancelled renders still winding down, andTypsty.running_renders/0reports how many are running. - Assigns are nested at most 128 levels deep.
- Links can only go to http, https, mailto and tel URLs (or relative ones):
others, such as
javascript:URLs from a template's data, are left out of PDFs and SVGs with a warning. SVGs escape the URLs that Typst doesn't. - PNG export refuses content placed far off the page, which takes minutes to draw.
- Renders with large assigns or files (over 32 MiB) drop Typst's caches when they finish, rather than keep them for later renders.
- Files are checked before Typst decodes them: images claiming more than 134
megapixels (including images inside SVGs), SVG and XML files nested more
than 1,024 levels deep, compressed SVGs expanding past 128 MiB, XML entities
that nest or expand past 16 MiB, SVGs with content far outside their canvas,
SVG turbulence filters of more than 24 octaves, PNG color profiles that
expand past 16 MiB, images without pixels, CBOR that declares more items
than it holds, deeply nested bibliographies and BibTeX references that cycle
or expand exponentially are refused, as are PDF files and SVGs inside SVGs
(which renders in a
Typsty.Poolcan read). Only regular files of at most 512 MiB are read from disk. - PNG export refuses pages that would need more than 2^28 pixels of textures.
- Typst keeps every file path for the life of the VM, with room for 65,535: a
render may use at most 10,000 paths, at most 50,000 different paths may be
given in
:filesover the life of the VM (or of a pool's worker), and renders needing a new path are stopped before the table runs out. ATypsty.Poolreplaces a worker whose table is nearly full.
- Renders run on threads of their own with large stacks (as does Typst's
thread pool), so deep recursion can't overflow a scheduler's stack, and
panics become