typwriter 0.14.21

A Rust library for compiling, formatting, and watching Typst documents, with PDF metadata and permission management.
Documentation
[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 }

# Formatting
typstyle-core = { version = "0.14", optional = true }

# PDF metadata management
lopdf = { version = "0.38", optional = true }
xmp-writer = { version = "0.3", optional = true }

# PDF permission setting
qpdf = { version = "0.3", features = ["vendored"], optional = true }

# Ser/de support
serde = { version = "1.0", features = ["derive"] }

# Watch server
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 in browser
open = { version = "5.3", optional = true }

# logging
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",
]

# Enable these features to select capabilities.
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"]

# Enable these features to embed fonts into the binary.
## assets/fonts/ComputerModern/cmunrm.ttf
embed_cmu_roman = ["compile"]
## assets/fonts/iAWriterDuo/iAWriterDuoS-*
embed_ia_writer_duo = ["compile"]
## assets/fonts/NotoEmoji/NotoEmoji-VariableFont_wght.ttf
embed_noto_emoji = ["compile"]
## assets/fonts/NotoSansJP/NotoSansJP-*
embed_noto_sans_jp = ["compile"]
## assets/fonts/NotoSerifJP/NotoSerifJP-*
embed_noto_serif_jp = ["compile"]
## assets/fonts/Recursive/recursive-static-OTFs.otc
embed_recursive = ["compile"]
## assets/fonts/SourceCodePro/SourceCodePro-*
embed_source_code_pro = ["compile"]
## assets/fonts/WarpnineMono/WarpnineMono-*
embed_warpnine_mono = ["compile"]
## assets/fonts/WarpnineMono/WarpnineSansCondensed-*
embed_warpnine_sans = ["compile"]
## all of the above
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",
]