From 5ac7eb3860ebd3247f6486c227e816894cb8fd91 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 11 Mar 2022 12:59:55 +0100 Subject: Rename template to content --- src/lib.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 8ef538c5..cb434e62 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ //! provided in the [AST] module. //! - **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], a hierarchical, styled representation with the contents +//! and [content], a hierarchical, styled representation with the contents //! of the module. The nodes of this tree are well structured and //! order-independent and thus much better suited for layouting than the raw //! markup. @@ -23,8 +23,8 @@ //! [AST]: syntax::ast //! [evaluate]: eval::Eval //! [module]: eval::Module -//! [template]: eval::Template -//! [layouted]: eval::Template::layout +//! [content]: eval::Content +//! [layouted]: eval::Content::layout //! [PDF]: export::pdf #![allow(clippy::len_without_is_empty)] @@ -110,8 +110,8 @@ impl Context { /// Evaluate a source file and return the resulting module. /// - /// Returns either a module containing a scope with top-level bindings and a - /// layoutable template or diagnostics in the form of a vector of error + /// Returns either a module containing a scope with top-level bindings and + /// layoutable contents or diagnostics in the form of a vector of error /// messages with file and span information. pub fn evaluate(&mut self, id: SourceId) -> TypResult { // Prevent cyclic evaluation. @@ -139,16 +139,12 @@ impl Context { // Evaluate the module. let prev = std::mem::replace(&mut self.deps, vec![(id, source.rev())]); self.route.push(id); - let template = ast.eval(self, &mut scp); + let content = ast.eval(self, &mut scp); self.route.pop().unwrap(); let deps = std::mem::replace(&mut self.deps, prev); // Assemble the module. - let module = Module { - scope: scp.top, - template: template?, - deps, - }; + let module = Module { scope: scp.top, content: content?, deps }; // Save the evaluated module. self.modules.insert(id, module.clone()); @@ -162,7 +158,7 @@ impl Context { /// diagnostics in the form of a vector of error message with file and span /// information. pub fn typeset(&mut self, id: SourceId) -> TypResult>> { - self.evaluate(id)?.template.layout(self) + self.evaluate(id)?.content.layout(self) } /// Resolve a user-entered path (relative to the current evaluation -- cgit v1.2.3