From 96f72eee6c6b595164c7a0576c407d7a590661db Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 24 Nov 2022 17:51:07 +0100 Subject: Separate typesetting and compilation --- src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 75200144..4607cd0c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,16 +49,16 @@ use comemo::{Prehashed, Track}; use crate::diag::{FileResult, SourceResult}; use crate::font::{Font, FontBook}; use crate::frame::Frame; -use crate::model::{Library, Route, StyleChain}; +use crate::model::{Library, Route}; use crate::syntax::{Source, SourceId}; use crate::util::Buffer; -/// Typeset a source file into a collection of layouted frames. +/// Compile a source file into a collection of layouted frames. /// /// Returns either a vector of frames representing individual pages or /// diagnostics in the form of a vector of error message with file and span /// information. -pub fn typeset( +pub fn compile( world: &(dyn World + 'static), source: &Source, ) -> SourceResult> { @@ -66,10 +66,8 @@ pub fn typeset( let route = Route::default(); let module = model::eval(world.track(), route.track(), source)?; - // Layout the module's contents. - let library = world.library(); - let styles = StyleChain::with_root(&library.styles); - (library.items.layout)(&module.content, world.track(), styles) + // Typeset the module's contents. + model::typeset(world.track(), &module.content) } /// The environment in which typesetting occurs. -- cgit v1.2.3