summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-17 16:27:40 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-17 18:18:47 +0100
commitaf7fe4d76083c597ec2198a73383b9e3899d75ea (patch)
treecb3b9766ee15dbfbecf7f9b9a2257859d7a7b3c7 /docs
parent6d64d3e8e9123f3fa8166c8b710e2b2c61ed5898 (diff)
Hover and autocomplete in show rules
Diffstat (limited to 'docs')
-rw-r--r--docs/src/html.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/docs/src/html.rs b/docs/src/html.rs
index fc9d7d9e..206dee00 100644
--- a/docs/src/html.rs
+++ b/docs/src/html.rs
@@ -307,7 +307,7 @@ fn code_block(resolver: &dyn Resolver, lang: &str, text: &str) -> Html {
let source = Source::new(SourceId::from_u16(0), Path::new("main.typ"), compile);
let world = DocWorld(source);
- let mut frames = match typst::compile(&world, &world.0) {
+ let mut frames = match typst::compile(&world) {
Ok(doc) => doc.pages,
Err(err) => {
let msg = &err[0].message;
@@ -335,6 +335,19 @@ impl World for DocWorld {
&LIBRARY
}
+ fn main(&self) -> &Source {
+ &self.0
+ }
+
+ fn resolve(&self, _: &Path) -> FileResult<SourceId> {
+ unimplemented!()
+ }
+
+ fn source(&self, id: SourceId) -> &Source {
+ assert_eq!(id.into_u16(), 0, "invalid source id");
+ &self.0
+ }
+
fn book(&self) -> &Prehashed<FontBook> {
&FONTS.0
}
@@ -350,13 +363,4 @@ impl World for DocWorld {
.contents()
.into())
}
-
- fn resolve(&self, _: &Path) -> FileResult<SourceId> {
- unimplemented!()
- }
-
- fn source(&self, id: SourceId) -> &Source {
- assert_eq!(id.into_u16(), 0, "invalid source id");
- &self.0
- }
}