The web preview endpoint (POST /api/preview/render) requires:
typstCLI inPATHVendored QR package files in
typst/vendor/tiaomaOptional bundled Typst binary at
lib/typst/bin/typst(provided by thetypstshard postinstall build).
If the shard is installed but lib/typst/bin/typst is missing, rerun:
cd lib/typst
RUSTUP_TOOLCHAIN=1.92.0-x86_64-unknown-linux-gnu bash scripts/postinstall.sh
On startup, the server now probes Typst availability and logs either:
Typst preview enabled: ...Typst preview disabled: ...
The same status is exposed by GET /health:
typst_preview_availabletypst_preview_detail
Debian/Ubuntu installation options
Recommended for production reproducibility:
- Install from official Typst release binaries and pin a version.
- Place
typstin/usr/local/bin(or another managed path).
Example (x86_64):
TYPST_VERSION="0.14.2"
curl -fsSL "https://github.com/typst/typst/releases/download/v${TYPST_VERSION}/typst-x86_64-unknown-linux-musl.tar.xz" -o /tmp/typst.tar.xz
tar -xJf /tmp/typst.tar.xz -C /tmp
sudo install -m 0755 /tmp/typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst
typst --version
Use typst-aarch64-unknown-linux-musl.tar.xz for aarch64.
Alternative option:
cargo install --locked typst-cli
Notes:
- Package-manager builds may lag behind upstream releases.
- Snap installs can hit confinement errors (
failed to load file (access denied)) when rendering project-local Typst/plugin files. For this app, prefer official binary or cargo installs.
Quick verification
typst --version
curl -fsS http://127.0.0.1:30000/health | jq .
Authoring behavior
The preview translator supports a compact subset of Typst-friendly authoring:
#font(...),#place(...),#qr(...),#event(...), and#contact(...)directives.- Markdown-style headings (
# Heading) converted to bold text with a line break. - Inline Typst links written as
#link("url")[Label]inside normal text lines.