From 04bffc4f12ff7dd85d25f5fd65506440287f879c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 28 Jun 2023 10:35:44 +0200 Subject: Reintroduce `--root` --- docs/src/html.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/src') diff --git a/docs/src/html.rs b/docs/src/html.rs index a6e58b73..e1f294ee 100644 --- a/docs/src/html.rs +++ b/docs/src/html.rs @@ -415,7 +415,7 @@ fn code_block(resolver: &dyn Resolver, lang: &str, text: &str) -> Html { return Html::new(format!("
{}
", highlighted.as_str())); } - let id = FileId::new(None, Path::new("main.typ")); + let id = FileId::new(None, Path::new("/main.typ")); let source = Source::new(id, compile); let world = DocWorld(source); let mut frames = match typst::compile(&world) { @@ -486,7 +486,7 @@ impl World for DocWorld { fn file(&self, id: FileId) -> FileResult { assert!(id.package().is_none()); Ok(FILES - .get_file(id.path()) + .get_file(id.path().strip_prefix("/").unwrap()) .unwrap_or_else(|| panic!("failed to load {:?}", id.path().display())) .contents() .into()) -- cgit v1.2.3