Expand description
Typst markup renderer.
Converts a SurfDoc block tree into valid Typst markup text. The output can
be compiled by the Typst engine to produce PDF (or other formats).
Markdown content within blocks is converted to Typst markup via the
md_to_typst helper. All user content is escaped to prevent Typst
injection.
Structs§
- Image
Scope - RAII guard that clears the ambient image map when dropped.
Functions§
- install_
image_ context - Install
map(image src → resolvable virtual file path) as the ambient image context for the current thread for the lifetime of the returned guard. The PDF renderer installs this beforeto_typstafter registering the mapped paths with the engine’s static file resolver. - md_
to_ typst - Convert a markdown string to Typst markup (block-level).
- md_
to_ typst_ inline - Convert inline markdown to Typst inline markup.
- to_
typst - Render a
SurfDocas a complete Typst document string.