summaryrefslogtreecommitdiff
path: root/src/library/mod.rs
blob: 74f77204db0561b34b8d5835d67d26ea12bbb5cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! The standard library for the _Typst_ language.

use crate::func::Scope;

mod structure;
mod style;

pub use structure::*;
pub use style::*;

/// Create a scope with all standard functions.
pub fn std() -> Scope {
    let mut std = Scope::new();

    std.add::<Align>("align");
    std.add::<Boxed>("box");

    std.add::<Linebreak>("line.break");
    std.add::<Linebreak>("n");
    std.add::<Pagebreak>("page.break");

    std.add::<HorizontalSpace>("h");
    std.add::<VerticalSpace>("v");

    std.add::<Bold>("bold");
    std.add::<Italic>("italic");
    std.add::<Monospace>("mono");

    std
}