pub struct RenderTemplateRequest {
pub template_source: String,
pub data: String,
pub meta: DocMeta,
pub brand: Option<BrandSpec>,
pub format: TemplateFormat,
pub assets: AssetManifest,
pub fonts: Vec<String>,
pub generated: Vec<GeneratedAsset>,
}Expand description
Render a user-supplied typst template over structured data — the
render-template path (TemplateDoc), which bypasses ResolvedDoc
entirely.
Fields§
§template_source: StringTypst source of the main template. Inline source rather than
TemplateDoc.template’s provider key: the server has no view of the
caller’s filesystem, and the template is the one file a caller always
authors itself.
data: StringThe JSON document the template reads with json("/data.json"),
carried verbatim as text. A string, not a parsed value, so this crate
needs no JSON implementation of its own — the bytes go straight into
the virtual /data.json.
meta: DocMeta§brand: Option<BrandSpec>§format: TemplateFormat§assets: AssetManifestSibling files the template #imports or #images, under the provider
keys it references them by.
fonts: Vec<String>Font faces to register with the typst compile, as manifest keys into
assets, in declaration order (typst tie-breaks by it). The template
path’s counterpart to RenderOptions::layout_fonts: without it a
brand’s non-system faces silently fall back to whatever the server
host has installed.
generated: Vec<GeneratedAsset>Images the server generates and serves at their path alongside
assets — e.g. a payment QR code the template #images, without the
caller needing a QR library.