Skip to main content

typst_kit/
lib.rs

1//! Typst Kit contains useful building blocks for Typst integrations. It is
2//! intended as a single source of truth for things like font searching, package
3//! loading and more. In particular, it contains various implementations of
4//! functionality used in `typst-cli`.
5//!
6//! # Features flags
7//! Crate functionality that incurs additional dependencies is heavily
8//! feature-flagged, so that you can pick exactly what you need. By default, all
9//! features are disabled. The available feature flags are:
10//!
11//! - `bundle`: Enables functionality related to [`typst_bundle`].
12//! - `embedded-fonts`: Enables loading of embedded fonts via
13//!   [`fonts::embedded`].
14//! - `scan-fonts`: Enables font discovery at paths and from the system via
15//!   [`fonts::scan`] and [`fonts::system`].
16//! - `system-files`: Enables loading of files from standard locations via
17//!   [`files::SystemFiles`].
18//! - `system-packages`: Enables loading of packages from standard locations via
19//!   [`packages::SystemPackages`].
20//! - `universe-packages`: Enables loading of packages from Typst Universe via
21//!   [`packages::UniversePackages`].
22//! - `emit-diagnostics`: Enables emitting terminal-style diagnostics via
23//! - `datetime`: Enables obtaining the current date via [`datetime::Time::today`].
24//!   [`diagnostics::emit`].
25//! - `system-downloader`: Enables network requests via
26//!   [`downloader::SystemDownloader`].
27//! - `watcher`: Enables file system watching via [`watcher::Watcher`].
28//! - `timer`: Enables performance tracing via [`timer::Timer`].
29//! - `http-server`: Enables a live-reloading HTTP serving via [`server::HttpServer`].
30//! - `vendor-openssl`: Whether to vendor OpenSSL for the `system-downloader`.
31//!   Not applicable to Windows and macOS build.
32
33#![cfg_attr(docsrs, feature(doc_cfg))]
34#![cfg_attr(
35    not(all(
36        feature = "bundle",
37        feature = "embedded-fonts",
38        feature = "scan-fonts",
39        feature = "system-files",
40        feature = "system-packages",
41        feature = "universe-packages",
42        feature = "emit-diagnostics",
43        feature = "datetime",
44        feature = "system-downloader",
45        feature = "watcher",
46        feature = "timer",
47        feature = "http-server",
48    )),
49    allow(rustdoc::broken_intra_doc_links)
50)]
51
52pub mod datetime;
53pub mod diagnostics;
54pub mod downloader;
55pub mod files;
56pub mod fonts;
57pub mod packages;
58pub mod server;
59pub mod timer;
60pub mod watcher;