diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-10-27 19:04:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-27 18:04:55 +0000 |
| commit | be7cfc85d08c545abfac08098b7b33b4bd71f37e (patch) | |
| tree | f4137fa2aaa57babae1f7603a9b2ed7e688f43d8 /crates/typst-library/src/foundations/sys.rs | |
| parent | b8034a343831e8609aec2ec81eb7eeda57aa5d81 (diff) | |
Split out four new crates (#5302)
Diffstat (limited to 'crates/typst-library/src/foundations/sys.rs')
| -rw-r--r-- | crates/typst-library/src/foundations/sys.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/typst-library/src/foundations/sys.rs b/crates/typst-library/src/foundations/sys.rs new file mode 100644 index 00000000..7c128104 --- /dev/null +++ b/crates/typst-library/src/foundations/sys.rs @@ -0,0 +1,18 @@ +//! System-related things. + +use crate::foundations::{Dict, Module, Scope, Version}; + +/// A module with system-related things. +pub fn module(inputs: Dict) -> Module { + let mut scope = Scope::deduplicating(); + scope.define( + "version", + Version::from_iter([ + env!("CARGO_PKG_VERSION_MAJOR").parse::<u32>().unwrap(), + env!("CARGO_PKG_VERSION_MINOR").parse::<u32>().unwrap(), + env!("CARGO_PKG_VERSION_PATCH").parse::<u32>().unwrap(), + ]), + ); + scope.define("inputs", inputs); + Module::new("sys", scope) +} |
