summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-17 14:38:48 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-23 20:23:47 +0200
commit5becb32ba463d6b0ace914ab06bb237483a94fbc (patch)
tree684efb242ddb04e71c54f9665cc59891f734e518 /src/lib.rs
parentc627847cb39572c08f3b53db07ea325ef0d352fa (diff)
Introduce page / block / inline levels
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ed90fed4..2ae87fc6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -8,7 +8,7 @@
//! - **Evaluation:** The next step is to [evaluate] the markup. This produces a
//! [module], consisting of a scope of values that were exported by the code
//! and a template with the contents of the module. This template can be
-//! [instantiated] with a style to produce a layout tree, a high-level, fully
+//! instantiated with a style to produce a layout tree, a high-level, fully
//! styled representation of the document. The nodes of this tree are
//! self-contained and order-independent and thus much better suited for
//! layouting than the raw markup.
@@ -23,7 +23,6 @@
//! [markup]: syntax::Markup
//! [evaluate]: eval::eval
//! [module]: eval::Module
-//! [instantiated]: eval::Template::to_tree
//! [layout tree]: layout::LayoutTree
//! [layouted]: layout::layout
//! [PDF]: export::pdf
@@ -53,7 +52,7 @@ use crate::font::FontStore;
use crate::image::ImageStore;
#[cfg(feature = "layout-cache")]
use crate::layout::{EvictionPolicy, LayoutCache};
-use crate::layout::{Frame, LayoutTree};
+use crate::layout::{Frame, PageNode};
use crate::loading::Loader;
use crate::source::{SourceId, SourceStore};
use crate::style::Style;
@@ -110,10 +109,10 @@ impl Context {
eval::eval(self, id, &ast)
}
- /// Execute a source file and produce the resulting layout tree.
- pub fn execute(&mut self, id: SourceId) -> TypResult<LayoutTree> {
+ /// Execute a source file and produce the resulting page nodes.
+ pub fn execute(&mut self, id: SourceId) -> TypResult<Vec<PageNode>> {
let module = self.evaluate(id)?;
- Ok(module.template.to_tree(&self.style))
+ Ok(module.template.to_pages(&self.style))
}
/// Typeset a source file into a collection of layouted frames.