summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-09-15 12:43:57 +0200
committerLaurenz <laurmaedje@gmail.com>2021-09-15 13:05:01 +0200
commit5de791d9e6a1006dc6a017ec8e20a1c70a91a780 (patch)
tree65a60ca99c10322d6a7411ec8abce9f488e4a89d /src/lib.rs
parentc18321a4c24b1bae9b935e3434aa114f930ca5f5 (diff)
Rename `SyntaxTree` to `Markup`
Also `SyntaxNode` -> `MarkupNode`.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b2d48a2b..fa988207 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,25 +2,26 @@
//!
//! # Steps
//! - **Parsing:** The parsing step first transforms a plain string into an
-//! [iterator of tokens][tokens]. This token stream is [parsed] into a [syntax
-//! tree]. The structures describing the tree can be found in the [syntax]
-//! module.
-//! - **Evaluation:** The next step is to [evaluate] the syntax tree. This
-//! produces a [module], consisting of a scope of values that were exported by
-//! the module and a template with the contents of the module. This template
-//! can be [instantiated] in a state to produce a layout tree, a high-level,
-//! fully styled representation of the document. The nodes of this tree are
+//! [iterator of tokens][tokens]. This token stream is [parsed] into [markup].
+//! The syntactical structures describing markup and embedded code can be
+//! found in the [syntax] 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 with the contents of the module. This template can be
+//! [instantiated] in a state 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 a syntax tree.
+//! layouting than the raw markup.
//! - **Layouting:** Next, the tree is [layouted] into a portable version of the
//! typeset document. The output of this is a collection of [`Frame`]s (one
//! per page), ready for exporting.
//! - **Exporting:** The finished layout can be exported into a supported
//! format. Currently, the only supported output format is [PDF].
//!
+
//! [tokens]: parse::Tokens
//! [parsed]: parse::parse
-//! [syntax tree]: syntax::SyntaxTree
+//! [markup]: syntax::Markup
//! [evaluate]: eval::eval
//! [module]: eval::Module
//! [instantiated]: eval::Template::to_tree
@@ -57,7 +58,7 @@ use crate::layout::{EvictionPolicy, LayoutCache};
use crate::layout::{Frame, LayoutTree};
use crate::loading::Loader;
use crate::source::{SourceId, SourceStore};
-use crate::syntax::SyntaxTree;
+use crate::syntax::Markup;
/// The core context which holds the loader, configuration and cached artifacts.
pub struct Context {
@@ -99,8 +100,8 @@ impl Context {
&self.state
}
- /// Parse a source file and return the resulting syntax tree.
- pub fn parse(&mut self, id: SourceId) -> TypResult<SyntaxTree> {
+ /// Parse a source file and return the resulting markup.
+ pub fn parse(&mut self, id: SourceId) -> TypResult<Markup> {
parse::parse(self.sources.get(id))
}