diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-08 16:39:37 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-09 12:34:19 +0100 |
| commit | e089b6ea40015e012302dc55ac5d6cb42ca4876e (patch) | |
| tree | dbb66237cb996bc880560dfd94ac9b682e1ac985 /src/library/mod.rs | |
| parent | 68503b9a07b00bce3f4d377bcfe945452de815ea (diff) | |
Set rules for everything
Diffstat (limited to 'src/library/mod.rs')
| -rw-r--r-- | src/library/mod.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/library/mod.rs b/src/library/mod.rs index ef0fa016..b2cb8698 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -14,18 +14,20 @@ pub mod hide; pub mod image; pub mod link; pub mod list; +pub mod math; pub mod pad; pub mod page; pub mod par; pub mod place; +pub mod raw; pub mod shape; pub mod spacing; pub mod stack; pub mod table; pub mod text; pub mod transform; -pub mod utility; +pub mod utility; pub use self::image::*; pub use align::*; pub use columns::*; @@ -37,10 +39,12 @@ pub use heading::*; pub use hide::*; pub use link::*; pub use list::*; +pub use math::*; pub use pad::*; pub use page::*; pub use par::*; pub use place::*; +pub use raw::*; pub use shape::*; pub use spacing::*; pub use stack::*; @@ -68,13 +72,13 @@ prelude! { pub use crate::diag::{At, TypResult}; pub use crate::eval::{ - Args, Construct, EvalContext, Merge, Property, Scope, Set, Smart, StyleChain, - StyleMap, StyleVec, Template, Value, + Args, Construct, EvalContext, Merge, Property, Scope, Set, Show, ShowNode, Smart, + StyleChain, StyleMap, StyleVec, Template, Value, }; pub use crate::frame::*; pub use crate::geom::*; pub use crate::layout::{ - Constrain, Constrained, Constraints, Layout, LayoutContext, PackedNode, Regions, + Constrain, Constrained, Constraints, Layout, LayoutContext, LayoutNode, Regions, }; pub use crate::syntax::{Span, Spanned}; pub use crate::util::{EcoString, OptionExt}; @@ -95,6 +99,8 @@ pub fn new() -> Scope { std.def_class::<TextNode>("text"); std.def_class::<StrongNode>("strong"); std.def_class::<EmphNode>("emph"); + std.def_class::<RawNode>("raw"); + std.def_class::<MathNode>("math"); std.def_class::<DecoNode<Underline>>("underline"); std.def_class::<DecoNode<Strikethrough>>("strike"); std.def_class::<DecoNode<Overline>>("overline"); @@ -207,9 +213,9 @@ castable! { castable! { NonZeroUsize, Expected: "positive integer", - Value::Int(int) => int + Value::Int(int) => Value::Int(int) + .cast::<usize>()? .try_into() - .and_then(usize::try_into) .map_err(|_| "must be positive")?, } @@ -226,7 +232,7 @@ castable! { } castable! { - PackedNode, + LayoutNode, Expected: "template", Value::Template(template) => template.pack(), } |
