typst_library/pdf/
mod.rs

1//! PDF-specific functionality.
2
3mod accessibility;
4mod attach;
5
6pub use self::accessibility::*;
7pub use self::attach::*;
8
9use crate::foundations::{Deprecation, Element, Module, Scope};
10use crate::{Feature, Features};
11
12/// Hook up all `pdf` definitions.
13pub fn module(features: &Features) -> Module {
14    let mut pdf = Scope::deduplicating();
15    pdf.start_category(crate::Category::Pdf);
16    pdf.define_elem::<AttachElem>();
17    pdf.define("embed", Element::of::<AttachElem>()).deprecated(
18        // Remember to remove "embed" from `path_completion` when removing this.
19        Deprecation::new()
20            .with_message("the name `embed` is deprecated, use `attach` instead")
21            .with_until("0.15.0"),
22    );
23    pdf.define_elem::<ArtifactElem>();
24    if features.is_enabled(Feature::A11yExtras) {
25        pdf.define_func::<table_summary>();
26        pdf.define_func::<header_cell>();
27        pdf.define_func::<data_cell>();
28    }
29    Module::new("pdf", pdf)
30}