diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-28 10:35:44 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-28 10:36:53 +0200 |
| commit | 04bffc4f12ff7dd85d25f5fd65506440287f879c (patch) | |
| tree | 311a78d174f95c6e4733e3eb17a40f78744c3854 /docs/src | |
| parent | 7b92bd7c340d9f9c094ed2fa57912049317d9b20 (diff) | |
Reintroduce `--root`
Diffstat (limited to 'docs/src')
| -rw-r--r-- | docs/src/html.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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!("<pre>{}</pre>", 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<Bytes> { 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()) |
