Crate typst_bake

Crate typst_bake 

Source
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§

CategoryStats
Statistics for a category of files (templates, fonts)
Document
A document ready for PDF generation.
EmbedStats
Compression statistics for all embedded content
PackageInfo
Statistics for a single package
PackageStats
Statistics for all packages

Functions§

rebuild_if_changed
Emits cargo:rerun-if-changed directives for template and font directories.

Derive Macros§

IntoDict
Derive macro for adding into_dict() method. Derive macro for adding into_dict() method to structs.
IntoValue
Derive macro for implementing IntoValue trait. Derive macro for implementing IntoValue trait.