summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-12-02 13:32:06 +0100
committerLaurenz <laurmaedje@gmail.com>2024-12-04 10:12:07 +0100
commit2b8dc9b14da365cb36345d41fd1ca93894f50c68 (patch)
treed5494e93f107df548b45ada6e5a10b2c817825a9
parent008b59839f276bc5563fea2ac3350da63a0355d8 (diff)
Add HTML feature flag
-rw-r--r--crates/typst-cli/src/args.rs4
-rw-r--r--crates/typst-cli/src/world.rs11
-rw-r--r--crates/typst-library/src/lib.rs4
3 files changed, 14 insertions, 5 deletions
diff --git a/crates/typst-cli/src/args.rs b/crates/typst-cli/src/args.rs
index 9437f848..bc3d1225 100644
--- a/crates/typst-cli/src/args.rs
+++ b/crates/typst-cli/src/args.rs
@@ -283,7 +283,9 @@ pub struct SharedArgs {
/// An in-development feature that may be changed or removed at any time.
#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)]
-pub enum Feature {}
+pub enum Feature {
+ Html,
+}
/// Arguments related to where packages are stored in the system.
#[derive(Debug, Clone, Args)]
diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs
index a04de2c0..6e6de0dc 100644
--- a/crates/typst-cli/src/world.rs
+++ b/crates/typst-cli/src/world.rs
@@ -17,7 +17,7 @@ use typst_kit::fonts::{FontSlot, Fonts};
use typst_kit::package::PackageStorage;
use typst_timing::timed;
-use crate::args::{Input, SharedArgs};
+use crate::args::{Feature, Input, SharedArgs};
use crate::compile::ExportCache;
use crate::download::PrintDownload;
use crate::package;
@@ -112,8 +112,13 @@ impl SystemWorld {
.map(|(k, v)| (k.as_str().into(), v.as_str().into_value()))
.collect();
- let features =
- command.feature.iter().map(|&feature| match feature {}).collect();
+ let features = command
+ .feature
+ .iter()
+ .map(|&feature| match feature {
+ Feature::Html => typst::Feature::Html,
+ })
+ .collect();
Library::builder().with_inputs(inputs).with_features(features).build()
};
diff --git a/crates/typst-library/src/lib.rs b/crates/typst-library/src/lib.rs
index bd135cdb..5aec0916 100644
--- a/crates/typst-library/src/lib.rs
+++ b/crates/typst-library/src/lib.rs
@@ -231,7 +231,9 @@ impl FromIterator<Feature> for Features {
/// An in-development feature that should be enabled.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
#[non_exhaustive]
-pub enum Feature {}
+pub enum Feature {
+ Html,
+}
/// Construct the module with global definitions.
fn global(math: Module, inputs: Dict) -> Module {