[package]
name = "typwriter"
description = "A Rust library for compiling, formatting, and watching Typst documents, with PDF metadata and permission management."
version = "0.14.21"
edition = "2024"
authors = ["kaoru <k@warpnine.io>"]
license = "Apache-2.0"
exclude = ["tests/", "examples/", ".gitignore", "rustfmt.toml", "*.pdf", "*.png"]
homepage = "https://github.com/0x6b/typwriter"
repository = "https://github.com/0x6b/typwriter"
documentation = "https://docs.rs/typwriter"
readme = "README.md"
categories = ["text-processing"]
keywords = ["typst", "typesetting", "compile", "pdf", "formatter"]
[lib]
name = "typwriter"
path = "src/lib.rs"
[dependencies]
chrono = { version = "0.4", default-features = false, features = ["clock", "std"], optional = true }
ecow = { version = "0.2", features = ["serde"], optional = true }
fontdb = { version = "0.23", optional = true }
once_cell = "1.21"
parking_lot = "0.12"
typst = { version = "0.14.2", optional = true }
typst-assets = { version = "0.14.2", features = ["fonts"], optional = true }
typst-kit = { version = "0.14.2", optional = true }
typst-pdf = { version = "0.14.2", optional = true }
typst-render = { version = "0.14.2", optional = true }
typst-syntax = { version = "0.14.2", optional = true }
typst-timing = { version = "0.14.2", optional = true }
typst-utils = { version = "0.14.2", optional = true }
typstyle-core = { version = "0.14", optional = true }
lopdf = { version = "0.38", optional = true }
xmp-writer = { version = "0.3", optional = true }
qpdf = { version = "0.3", features = ["vendored"], optional = true }
serde = { version = "1.0", features = ["derive"] }
axum = { version = "0.8", features = ["ws"], optional = true }
notify = { version = "8.2", optional = true }
tokio = { version = "1.49", features = ["fs", "macros", "net", "rt-multi-thread", "signal"], optional = true }
open = { version = "5.3", optional = true }
log = { version = "0.4", default-features = false, optional = true }
[build-dependencies]
dirs = "6"
flate2 = "1"
serde = { version = "1.0", features = ["derive"] }
tar = "0.4"
toml = "0.9"
ureq = "2"
zip = "2"
[dev-dependencies]
anyhow = "1.0"
sha2_hasher = { git = "https://github.com/0x6b/sha2_hasher", tag = "v0.2.0", features = ["sync"] }
test-context = "0.5"
tokio = { version = "1.49", features = ["net"] }
[features]
default = []
full = [
"compile",
"embed_additional_fonts",
"format",
"pdf_metadata",
"pdf_permission",
"watch",
]
compile = [
"dep:chrono",
"dep:ecow",
"dep:fontdb",
"dep:typst",
"dep:typst-assets",
"dep:typst-kit",
"dep:typst-pdf",
"dep:typst-render",
"dep:typst-syntax",
"dep:typst-timing",
"dep:typst-utils",
]
format = ["dep:typst-syntax", "dep:typstyle-core"]
pdf_metadata = ["dep:chrono", "dep:lopdf", "dep:xmp-writer"]
pdf_permission = ["dep:qpdf"]
watch = ["compile", "dep:axum", "dep:log", "dep:notify", "dep:open", "dep:tokio"]
embed_cmu_roman = ["compile"]
embed_ia_writer_duo = ["compile"]
embed_noto_emoji = ["compile"]
embed_noto_sans_jp = ["compile"]
embed_noto_serif_jp = ["compile"]
embed_recursive = ["compile"]
embed_source_code_pro = ["compile"]
embed_warpnine_mono = ["compile"]
embed_warpnine_sans = ["compile"]
embed_additional_fonts = [
"embed_cmu_roman",
"embed_ia_writer_duo",
"embed_noto_emoji",
"embed_noto_sans_jp",
"embed_noto_serif_jp",
"embed_recursive",
"embed_source_code_pro",
"embed_warpnine_mono",
"embed_warpnine_sans",
]