diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-19 17:57:31 +0100 |
| commit | 264a7dedd42e27cd9e604037640cf0594b2ec46b (patch) | |
| tree | d26feea399d54bb86bd44878f40293983bf5251d /src/library/par.rs | |
| parent | ca3df70e2a5069832d7d2135967674c34a155442 (diff) | |
Scheduled maintenance 🔨
- New naming scheme
- TextNode instead of NodeText
- CallExpr instead of ExprCall
- ...
- Less glob imports
- Removes Value::Args variant
- Removes prelude
- Renames Layouted to Fragment
- Moves font into env
- Moves shaping into layout
- Moves frame into separate module
Diffstat (limited to 'src/library/par.rs')
| -rw-r--r-- | src/library/par.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/library/par.rs b/src/library/par.rs index 8242bfdc..a7db46de 100644 --- a/src/library/par.rs +++ b/src/library/par.rs @@ -2,6 +2,9 @@ use super::*; /// `paragraph`: Configure paragraphs. /// +/// # Positional parameters +/// - Body: optional, of type `template`. +/// /// # Named parameters /// - Paragraph spacing: `spacing`, of type `linear` relative to current font size. /// - Line leading: `leading`, of type `linear` relative to current font size. @@ -10,11 +13,11 @@ use super::*; /// # Return value /// A template that configures paragraph properties. The effect is scoped to the /// body if present. -pub fn paragraph(ctx: &mut EvalContext, args: &mut ValueArgs) -> Value { +pub fn par(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let spacing = args.get(ctx, "spacing"); let leading = args.get(ctx, "leading"); let word_spacing = args.get(ctx, "word-spacing"); - let body = args.find::<ValueTemplate>(ctx); + let body = args.find::<TemplateValue>(ctx); Value::template("paragraph", move |ctx| { let snapshot = ctx.state.clone(); |
