Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.48.0.
Registry Render injects exactly one input into a template, sys.inputs.data, as a JSON string.
Those bytes are the RFC 8785 canonicalisation of the envelope below. The sha256 of those exact
bytes is the dataDigest the caller stores on the record.
#let payload = json(bytes(sys.inputs.data))#let d = payload.data#let L = payload.labels.arThe envelope
Section titled “The envelope”{ "data": {}, "assets": { "photo": "<base64>" }, "labels": { "ar": {}, "fr": {} }, "locale": "ar", "issuedAt": "2026-09-16T10:32:00Z", "document": { "id": "receipt", "version": 3 }, "signing": { "mode": "seal", "signerName": "Ministry of Licensing", "testOnly": false }}datais your request data, validated against the document’s schema.assetsholds request images. The template reads them as virtual files, such asimage("/assets/photo").labelsholds every label table the document declared in its manifest.localeis present only when the request sent one, and is validated.issuedAtis the document’s issuance claim. It is also the world clock and the PDF date.documentcarries the document type’sidand itsversionfrom the manifest.signingis present only on the seal route,POST /v1/seal/{type}, and incompile --preview-seal.
Labels
Section titled “Labels”labels is bundle-owned content: one label table per labels/<locale>.yaml (kind: RenderLabels),
whose labels map of key to text the template receives flat. Label keys match
^[a-z][a-z0-9_-]{0,63}$, for example example_title. The
Registry Render configuration reference lists the label table fields.
Label values use the shared display-text rules: multilingual joiners and direction marks remain valid, while controls that can invisibly reorder text are refused.
The manifest lists the locales in labels: [...], and the template receives every declared table,
so a bilingual document consumes both. A key present in one locale and missing from another is a
registry-render check error, not a runtime surprise. A key no locale declares is a template error
at compile time.
Assets
Section titled “Assets”assets values are the base64 text as received. The template never decodes them: reference the
decoded image as image("/assets/photo"), with the leading slash, because the assets namespace
sits at the bundle root. Hashing covers the exact bytes.
The issuance clock
Section titled “The issuance clock”issuedAt is the clock. datetime.today(), set document(date: auto), and the PDF creation date
all derive from it. A re-render with the same issuedAt and data is byte-identical; changing it
changes bytes.
The instant is normalised to UTC: 2026-09-16T13:32:00+03:00 and 2026-09-16T10:32:00Z are the
same render. The caller’s UTC offset is deliberately not preserved, and the envelope carries the
Z form only.
A local-date layout can still shift the instant: datetime.today(offset: 3) answers “what date is
it 3 hours after issuance”. The offset is total hours, so fractional values work and land at
full-second precision. An offset large enough to overflow the shift answers none instead of
failing.
Version, data and paths
Section titled “Version, data and paths”document.version is the template’s own version from the manifest, so print it on paper if you
like. The renderer version appears nowhere in the envelope or the PDF bytes.
Data is inert. Values are Typst values and are never evaluated; a string that looks like code is only a string.
Paths are contained. image() and read() resolve only exact keys in the immutable bundle
snapshot and the virtual /assets/... namespace. The renderer’s world refuses .. and absolute
paths, and bundle symlinks are refused before a snapshot is accepted.
What fixes the bytes
Section titled “What fixes the bytes”Each render starts a fresh Typst world, so no state or cached layout passes between requests. The
world offers three roots: the bundle, the request’s assets under a virtual assets/ path, and the
vendored packages. A path outside them is refused even when request data supplies it, and error
messages name virtual paths, never the host’s. Fonts load in a fixed order, the binary’s baseline
set and then the bundle’s sorted by path, because order decides fallback.
The PDF names a fixed creator with no version, so an upgrade that changes no layout changes no
bytes. Below Typst, the workspace lockfile pins the compression libraries, because a patch release
there can re-encode a stream and move every byte after it. The same inputs give the same bytes on
Linux and macOS. A seal takes its signing time from the host’s clock instead of issuedAt.
The signing member
Section titled “The signing member”signing means the file will be sealed. Only the seal route adds it. The render route and every
other render never do, so a template prints its seal block only on files that carry a seal.
The one exception is a preview. registry-render compile --preview-seal test-only (or
production, which sets testOnly) adds the member, with --signer-name <text> as signerName,
and signs nothing. Its output is byte for byte the first revision the seal route signs for the same
inputs, so a golden can cover a template’s sealed variant.
Read the member with payload.at("signing", default: none) so one template serves both routes.
modeis always"seal".signerNameis the seal certificate’s display name (its organisation, else its common name). It is absent when the certificate names neither.testOnlyistruewhen the runtime declaresassuranceProfile: local. Print a visible test marking then, because a test seal is not an official document. Theregistry-render initscaffold prints the block below, labelled.
The member is part of the canonical envelope, so a sealed render’s dataDigest differs from a plain
render of the same request. The signature itself is added after the template runs, as an invisible
field: the template draws no signature appearance.
#let signing = payload.at("signing", default: none)#if signing != none [ Electronically sealed by #signing.at("signerName", default: "the issuing authority"). #if signing.testOnly [ TEST SEAL: not a valid official document. ]]Authoring loop
Section titled “Authoring loop”Edit templates freely with upstream tooling: tinymist and VS Code give a live preview when you point
them at the source bundle. registry-render compile, validate and check accept raw source
during authoring.
When the bundle is ready, registry-render package --bundle <source> --output <new-directory>
validates the source and writes the shared SHA256SUMS envelope plus an optional REVISION.
registry-render serve always verifies that package, including an optional package.expectedDigest
pin, before it listens.
registry-render check verifies everything, including that every label character is drawable by
some bundle or baseline font. A successful render that prints tofu is wrong on paper, so coverage
gaps are named at check time and warnings fail --strict at render time.
serve includes X-Registry-Warning-Count on every PDF response, including zero for a render
without warnings. A host can withhold a document when that count is nonzero, and request
Accept: application/json to inspect warnings. Only the count reaches the header, never warning
text or document values.
When in doubt, the exact injected bytes are the ground truth:
registry-render compile ... --emit-envelope env.jsonThe repository carries three complete working example bundles: a bilingual right-to-left receipt, a PDF/A certificate, and an ID-1 card with a photo.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.