html changes

This commit is contained in:
Myriad-Dreamin 2025-02-02 19:11:50 +08:00
parent b746520a80
commit f9fc0e4872
2 changed files with 2 additions and 10 deletions

View file

@ -12,9 +12,7 @@ pub(crate) mod well_known {
pub use typst::layout::Abs as TypstAbs;
pub use typst::layout::PagedDocument as TypstPagedDocument;
pub use typst::html::HtmlDocument as TypstHtmlDocument;
pub use typst::model::Document as TypstPagedDocument;
pub use typst::text::Font as TypstFont;
@ -30,8 +28,6 @@ pub(crate) mod well_known {
pub enum TypstDocument {
/// The document compiled with `paged` target.
Paged(Arc<well_known::TypstPagedDocument>),
/// The document compiled with `html` target.
Html(Arc<well_known::TypstHtmlDocument>),
}
impl TypstDocument {
@ -39,7 +35,6 @@ impl TypstDocument {
pub fn info(&self) -> &typst::model::DocumentInfo {
match self {
Self::Paged(doc) => &doc.info,
Self::Html(doc) => &doc.info,
}
}
@ -48,7 +43,6 @@ impl TypstDocument {
pub fn introspector(&self) -> &typst::introspection::Introspector {
match self {
Self::Paged(doc) => &doc.introspector,
Self::Html(doc) => &doc.introspector,
}
}
}

View file

@ -5,13 +5,11 @@ use crate::args::CompileOnceArgs;
#[test]
#[cfg(feature = "system")]
fn test_args() {
use tinymist_std::typst::TypstPagedDocument;
let args = CompileOnceArgs::parse_from(["tinymist", "main.typ"]);
let verse = args
.resolve_system()
.expect("failed to resolve system universe");
let world = verse.snapshot();
let _res = typst::compile::<TypstPagedDocument>(&world);
let _res = typst::compile(&world);
}