Expand description
§typst-bake
Bake Typst templates, fonts, and packages into your binary for offline PDF generation.
§Quick Start
Add to your Cargo.toml:
[package.metadata.typst-bake]
template-dir = "./templates"
fonts-dir = "./fonts"
[dependencies]
typst-bake = "0.1"Then use the document!() macro:
ⓘ
let pdf = typst_bake::document!("main.typ")
.to_pdf()?;
std::fs::write("output.pdf", pdf)?;Macros§
- document
- Creates a Document with embedded templates, fonts, and packages.
Structs§
- Category
Stats - Statistics for a category of files (templates, fonts)
- Document
- A document ready for PDF generation.
- Embed
Stats - Compression statistics for all embedded content
- Package
Info - Statistics for a single package
- Package
Stats - Statistics for all packages
Functions§
- rebuild_
if_ changed - Emits
cargo:rerun-if-changeddirectives for template and font directories.