merman-typst-plugin
merman-typst-plugin is the experimental Typst WebAssembly plugin bridge for
merman.
The crate exports Typst-compatible wasm-minimal-protocol functions and delegates
rendering and validation to merman-bindings-core.
Current exported functions:
abi_version() -> bytespackage_version() -> bytescapabilities_json() -> bytesrender_svg_json(source: bytes, options_json: bytes) -> bytesvalidate_json(source: bytes, options_json: bytes) -> bytes
render_svg_json returns a stable JSON payload with ok, code,
code_name, message, and svg fields so the Typst package can render
placeholder or text errors without failing compilation.
ABI Boundary
Current Typst plugin ABI version: 1.
The plugin ABI covers the exported wasm-minimal-protocol function names and
their byte payload contracts. That includes the abi_version,
package_version, capabilities_json, render_svg_json, and validate_json
exports, plus the JSON schemas consumed or produced by those exports.
Typst wrapper API changes in packages/typst/merman/src/*.typ do not require a
plugin ABI bump when this WebAssembly surface remains stable. Bump
TYPST_PLUGIN_ABI_VERSION and update the ABI tests and package README mapping
when an export is added, removed, renamed, changes argument or return bytes, or
changes the render, validate, or capabilities JSON contract.
The package_version export reports the Rust crate version. The Typst package
version in packages/typst/merman/typst.toml is a separate @preview wrapper
version.
Build the default Typst render artifact with:
Build the bridge-only protocol artifact with:
Build a pure render artifact without validation analysis with:
Build the larger full-config/full-sanitization no-host artifact with:
Then check the Typst wasm surface with:
Smoke the plugin through a Typst-compatible wasmi host call with: