diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-12-27 20:45:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-12-27 20:45:20 +0100 |
| commit | ba3d43f7b2a18984be27f3d472884a19f3adce4c (patch) | |
| tree | 1c6ffa31145fb69c19319440969d2037b27b584f /src/library | |
| parent | 750d220bb080be077cd7ede6d18d485b1c3fb0c9 (diff) | |
Refresh function call and dictionary syntax
- No colon between function name and arguments, just whitespace
- "Named" arguments (previously "keyword" arguments) use colon instead of equals sign
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/layout.rs | 6 | ||||
| -rw-r--r-- | src/library/style.rs | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/library/layout.rs b/src/library/layout.rs index c014cc34..c888ea18 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -12,7 +12,7 @@ use crate::prelude::*; /// - first (optional, `Alignment`): An alignment for any of the two axes. /// - second (optional, `Alignment`): An alignment for the other axis. /// -/// # Keyword arguments +/// # Named arguments /// - `horizontal` (`Alignment`): An alignment for the horizontal axis. /// - `vertical` (`Alignment`): An alignment for the vertical axis. /// @@ -188,7 +188,7 @@ impl Display for SpecAlign { /// `box`: Layout content into a box. /// -/// # Keyword arguments +/// # Named arguments /// - `width` (`linear` relative to parent width): The width of the box. /// - `height` (`linear` relative to parent height): The height of the box. pub fn boxed(mut args: Args, ctx: &mut EvalContext) -> Value { @@ -268,7 +268,7 @@ fn spacing(mut args: Args, ctx: &mut EvalContext, axis: SpecAxis) -> Value { /// # Positional arguments /// - Paper name (optional, `Paper`). /// -/// # Keyword arguments +/// # Named arguments /// - `width` (`length`): The width of pages. /// - `height` (`length`): The height of pages. /// - `margins` (`linear` relative to sides): The margins for all sides. diff --git a/src/library/style.rs b/src/library/style.rs index 8b8d9f26..8571dac6 100644 --- a/src/library/style.rs +++ b/src/library/style.rs @@ -2,9 +2,9 @@ use std::rc::Rc; use fontdock::{FontStretch, FontStyle, FontWeight}; +use crate::color::{Color, RgbaColor}; use crate::eval::StringLike; use crate::geom::Linear; -use crate::color::{Color, RgbaColor}; use crate::prelude::*; /// `font`: Configure the font. @@ -13,7 +13,7 @@ use crate::prelude::*; /// - Font size (optional, `linear` relative to current font size). /// - Font families ... (optional, variadic, `Family`) /// -/// # Keyword arguments +/// # Named arguments /// - `style` (`Style`): The font style. /// - `weight` (`Weight`): The font weight. /// - `stretch` (`Stretch`): The font stretch. @@ -26,17 +26,17 @@ use crate::prelude::*; /// # Examples /// Set font size and font families. /// ```typst -/// [font: 12pt, "Arial", "Noto Sans", sans-serif] +/// [font 12pt, "Arial", "Noto Sans", sans-serif] /// ``` /// /// Redefine the default sans-serif family to a single font family. /// ```typst -/// [font: sans-serif="Source Sans Pro"] +/// [font sans-serif: "Source Sans Pro"] /// ``` /// /// Redefine the default emoji family with a fallback. /// ```typst -/// [font: emoji=("Segoe UI Emoji", "Noto Emoji")] +/// [font emoji: ("Segoe UI Emoji", "Noto Emoji")] /// ``` /// /// # Enumerations |
