Skip to main content

typst_library/foundations/
sys.rs

1//! System-related things.
2
3use crate::foundations::{Dict, Module, Scope, Version};
4
5/// A module with system-related things.
6pub fn module(inputs: Dict) -> Module {
7    let typst_version = typst_utils::version();
8    let version = Version::from_iter([
9        typst_version.major(),
10        typst_version.minor(),
11        typst_version.patch(),
12    ]);
13
14    let mut scope = Scope::deduplicating();
15    scope.define("version", version);
16    scope.define("inputs", inputs);
17    Module::new("sys", scope)
18}