mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Add HTML feature flag
This commit is contained in:
parent
008b59839f
commit
2b8dc9b14d
@ -283,7 +283,9 @@ pub struct SharedArgs {
|
|||||||
|
|
||||||
/// An in-development feature that may be changed or removed at any time.
|
/// An in-development feature that may be changed or removed at any time.
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)]
|
||||||
pub enum Feature {}
|
pub enum Feature {
|
||||||
|
Html,
|
||||||
|
}
|
||||||
|
|
||||||
/// Arguments related to where packages are stored in the system.
|
/// Arguments related to where packages are stored in the system.
|
||||||
#[derive(Debug, Clone, Args)]
|
#[derive(Debug, Clone, Args)]
|
||||||
|
@ -17,7 +17,7 @@ use typst_kit::fonts::{FontSlot, Fonts};
|
|||||||
use typst_kit::package::PackageStorage;
|
use typst_kit::package::PackageStorage;
|
||||||
use typst_timing::timed;
|
use typst_timing::timed;
|
||||||
|
|
||||||
use crate::args::{Input, SharedArgs};
|
use crate::args::{Feature, Input, SharedArgs};
|
||||||
use crate::compile::ExportCache;
|
use crate::compile::ExportCache;
|
||||||
use crate::download::PrintDownload;
|
use crate::download::PrintDownload;
|
||||||
use crate::package;
|
use crate::package;
|
||||||
@ -112,8 +112,13 @@ impl SystemWorld {
|
|||||||
.map(|(k, v)| (k.as_str().into(), v.as_str().into_value()))
|
.map(|(k, v)| (k.as_str().into(), v.as_str().into_value()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let features =
|
let features = command
|
||||||
command.feature.iter().map(|&feature| match feature {}).collect();
|
.feature
|
||||||
|
.iter()
|
||||||
|
.map(|&feature| match feature {
|
||||||
|
Feature::Html => typst::Feature::Html,
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
Library::builder().with_inputs(inputs).with_features(features).build()
|
Library::builder().with_inputs(inputs).with_features(features).build()
|
||||||
};
|
};
|
||||||
|
@ -231,7 +231,9 @@ impl FromIterator<Feature> for Features {
|
|||||||
/// An in-development feature that should be enabled.
|
/// An in-development feature that should be enabled.
|
||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum Feature {}
|
pub enum Feature {
|
||||||
|
Html,
|
||||||
|
}
|
||||||
|
|
||||||
/// Construct the module with global definitions.
|
/// Construct the module with global definitions.
|
||||||
fn global(math: Module, inputs: Dict) -> Module {
|
fn global(math: Module, inputs: Dict) -> Module {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user