summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs8
-rw-r--r--src/model/items.rs7
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dbef46e7..bb3a1c02 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -49,7 +49,7 @@ use comemo::{Prehashed, Track};
use crate::diag::{FileResult, SourceResult};
use crate::font::{Font, FontBook};
use crate::frame::Frame;
-use crate::model::{LangItems, Route, Scope, StyleMap};
+use crate::model::{LangItems, Route, Scope, StyleChain, StyleMap};
use crate::syntax::{Source, SourceId};
use crate::util::Buffer;
@@ -62,10 +62,12 @@ pub fn typeset(
world: &(dyn World + 'static),
main: SourceId,
) -> SourceResult<Vec<Frame>> {
- crate::model::set_lang_items(world.config().items);
+ let config = world.config();
+ crate::model::set_lang_items(config.items);
let route = Route::default();
let module = model::eval(world.track(), route.track(), main)?;
- item!(root)(world.track(), &module.content)
+ let styles = StyleChain::with_root(&config.styles);
+ item!(root)(&module.content, world.track(), styles)
}
/// The environment in which typesetting occurs.
diff --git a/src/model/items.rs b/src/model/items.rs
index 21d45b67..771756fe 100644
--- a/src/model/items.rs
+++ b/src/model/items.rs
@@ -42,8 +42,11 @@ macro_rules! item {
#[derive(Copy, Clone)]
pub struct LangItems {
/// The root layout function.
- pub root:
- fn(world: Tracked<dyn World>, document: &Content) -> SourceResult<Vec<Frame>>,
+ pub root: fn(
+ content: &Content,
+ world: Tracked<dyn World>,
+ styles: StyleChain,
+ ) -> SourceResult<Vec<Frame>>,
/// Access the em size.
pub em: fn(StyleChain) -> Abs,
/// Access the text direction.