Better examples for spacing functions

This commit is contained in:
Laurenz 2023-02-13 17:25:36 +01:00
parent 28b5c55cd5
commit 5233b1c50a

View File

@ -5,22 +5,20 @@ use crate::prelude::*;
/// # Spacing (H) /// # Spacing (H)
/// Insert horizontal spacing into a paragraph. /// Insert horizontal spacing into a paragraph.
/// ///
/// The spacing can be a length or a fractional. In the latter case, the /// The spacing can be absolute, relative, or fractional. In the last case, the
/// remaining space on the line is distributed among all fractional spacings /// remaining space on the line is distributed among all fractional spacings
/// according to their relative fractions. /// according to their relative fractions.
/// ///
/// ## Example /// ## Example
/// ```example /// ```example
/// #circle(fill: red) /// First #h(1cm) Second \
/// #h(1fr) /// First #h(30%) Second \
/// #circle(fill: yellow) /// First #h(2fr) Second #h(1fr) Third
/// #h(2fr)
/// #circle(fill: green)
/// ``` /// ```
/// ///
/// ## Mathematical Spacing /// ## Mathematical Spacing
/// In [mathematical formulas]($category/math), you can additionally use these /// In [mathematical formulas]($category/math), you can additionally use these
/// constants to add spacing between elements: `thin`, `med`, `thick, `quad`. /// constants to add spacing between elements: `thin`, `med`, `thick`, `quad`.
/// ///
/// ## Parameters /// ## Parameters
/// - amount: `Spacing` (positional, required) /// - amount: `Spacing` (positional, required)
@ -93,26 +91,25 @@ impl Behave for HNode {
} }
/// # Spacing (V) /// # Spacing (V)
/// Insert vertical spacing. /// Insert vertical spacing into a flow of blocks.
/// ///
/// The spacing can be a length or a fractional. In the latter case, the /// The spacing can be absolute, relative, or fractional. In the last case,
/// remaining space on the page is distributed among all fractional spacings /// the remaining space on the page is distributed among all fractional spacings
/// according to their relative fractions. /// according to their relative fractions.
/// ///
/// ## Example /// ## Example
/// ```example /// ```example
/// In this report, we will explore /// #grid(
/// the various ethical /// rows: 3cm,
/// considerations that must be /// columns: 6,
/// taken into account when /// gutter: 1fr,
/// conducting psychological /// [A #parbreak() B],
/// research: /// [A #v(0pt) B],
/// #v(5mm) /// [A #v(10pt) B],
/// /// [A #v(0pt, weak: true) B],
/// - Informed consent /// [A #v(40%, weak: true) B],
/// - Participant confidentiality /// [A #v(1fr) B],
/// - The use of /// )
/// vulnerable populations.
/// ``` /// ```
/// ///
/// ## Parameters /// ## Parameters