diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-14 10:09:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-14 10:09:44 +0100 |
| commit | 9ba4d2c134479aad876a0e2ac4cd1622a353109e (patch) | |
| tree | a94e0e6ae53a1ba440e869fca26cc2ea0b179057 /library/src/compute/data.rs | |
| parent | 4c73456fc1f5df8ebb3a89d9db657c3c54624d66 (diff) | |
New macro setup
Diffstat (limited to 'library/src/compute/data.rs')
| -rw-r--r-- | library/src/compute/data.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/src/compute/data.rs b/library/src/compute/data.rs index 4f6e3b67..57dce5c1 100644 --- a/library/src/compute/data.rs +++ b/library/src/compute/data.rs @@ -5,6 +5,7 @@ use typst::diag::{format_xml_like_error, FileError}; use crate::prelude::*; /// Read structured data from a CSV file. +#[func] pub fn csv(vm: &Vm, args: &mut Args) -> SourceResult<Value> { let Spanned { v: path, span } = args.expect::<Spanned<EcoString>>("path to csv file")?; @@ -45,6 +46,7 @@ fn format_csv_error(error: csv::Error) -> String { } /// Read structured data from a JSON file. +#[func] pub fn json(vm: &Vm, args: &mut Args) -> SourceResult<Value> { let Spanned { v: path, span } = args.expect::<Spanned<EcoString>>("path to json file")?; @@ -85,6 +87,7 @@ fn format_json_error(error: serde_json::Error) -> String { } /// Read structured data from an XML file. +#[func] pub fn xml(vm: &Vm, args: &mut Args) -> SourceResult<Value> { let Spanned { v: path, span } = args.expect::<Spanned<EcoString>>("path to xml file")?; |
