From 815ee3254c1f087771b7c38e6f85622f3aeddf7c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 22 Jan 2023 13:18:30 +0100 Subject: [PATCH] Formatting fixes --- library/src/layout/columns.rs | 16 ++++++++-------- library/src/layout/place.rs | 2 +- library/src/layout/spacing.rs | 24 ++++++++++++------------ src/geom/align.rs | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/library/src/layout/columns.rs b/library/src/layout/columns.rs index 6d90ecb27..2b09bb692 100644 --- a/library/src/layout/columns.rs +++ b/library/src/layout/columns.rs @@ -3,29 +3,29 @@ use crate::text::TextNode; /// # Columns /// Separate a region into multiple equally sized columns. -/// +/// /// The `column` function allows to separate the interior of any container into /// multiple columns. It will not equalize the height of the columns, instead, /// the columns will take up the height of their container or the remaining /// height on the page. The columns function can break across pages if /// necessary. -/// +/// /// ## Example /// ``` /// = Towards Advanced Deep Learning -/// +/// /// #box(height: 68pt, /// columns(2, gutter: 11pt)[ /// #set par(justify: true) /// This research was funded by the /// National Academy of Sciences. -/// NAoS provided support for field +/// NAoS provided support for field /// tests and interviews with a /// grant of up to USD 40.000 for a /// period of 6 months. /// ] /// ) -/// +/// /// In recent years, deep learning has /// increasingly been used to solve a /// variety of problems. @@ -150,11 +150,11 @@ impl Layout for ColumnsNode { /// # Column Break /// A forced column break. -/// +/// /// The function will behave like a [page break](@pagebreak) when used in a /// single column layout or the last column on a page. Otherwise, content after /// the column break will be placed in the next column. -/// +/// /// ## Example /// ``` /// #set page(columns: 2) @@ -163,7 +163,7 @@ impl Layout for ColumnsNode { /// revealed a hitherto unknown /// phenomenon of extraordinary /// significance. -/// +/// /// #colbreak() /// Through rigorous experimentation /// and analysis, we have discovered diff --git a/library/src/layout/place.rs b/library/src/layout/place.rs index 26ab7b183..c51c8289c 100644 --- a/library/src/layout/place.rs +++ b/library/src/layout/place.rs @@ -39,7 +39,7 @@ use crate::prelude::*; /// ### Example /// ``` /// #set align(center) -/// +/// /// #box( /// width: 80pt, /// height: 80pt, diff --git a/library/src/layout/spacing.rs b/library/src/layout/spacing.rs index 01bd9beaf..640cd53a3 100644 --- a/library/src/layout/spacing.rs +++ b/library/src/layout/spacing.rs @@ -4,11 +4,11 @@ use crate::prelude::*; /// # Spacing (H) /// Insert horizontal spacing into a paragraph. -/// +/// /// The spacing can be a length or a fractional. In the latter case, the /// remaining space on the line is distributed among all fractional spacings /// according to their relative fractions. -/// +/// /// ## Example /// ``` /// #circle(fill: red) @@ -26,7 +26,7 @@ use crate::prelude::*; /// If true, the spacing collapses at the start or end of a paragraph. /// Moreover, from multiple adjacent weak spacings all but the largest one /// collapse. -/// +/// /// ### Example /// ``` /// #h(1cm, weak: true) @@ -70,13 +70,13 @@ impl HNode { impl HNode { /// Normal strong spacing. - pub fn strong(amount: Spacing) -> Self { - Self { amount, weak: false } + pub fn strong(amount: impl Into) -> Self { + Self { amount: amount.into(), weak: false } } /// User-created weak spacing. - pub fn weak(amount: Spacing) -> Self { - Self { amount, weak: true } + pub fn weak(amount: impl Into) -> Self { + Self { amount: amount.into(), weak: true } } } @@ -99,7 +99,7 @@ impl Behave for HNode { /// # Spacing (V) /// Insert vertical spacing. -/// +/// /// The spacing can be a length or a fractional. In the latter case, the /// remaining space on the page is distributed among all fractional spacings /// according to their relative fractions. @@ -111,15 +111,15 @@ impl Behave for HNode { /// considerations that must be /// taken into account when /// conducting psychological -/// research: +/// research: /// #v(5mm) -/// +/// /// - Informed consent /// - Participant confidentiality /// - The use of /// vulnerable populations. /// ``` -/// +/// /// ## Parameters /// - amount: Spacing (positional, required) /// How much spacing to insert. @@ -129,7 +129,7 @@ impl Behave for HNode { /// from multiple adjacent weak spacings all but the largest one collapse. /// Weak spacings will always collapse adjacent paragraph spacing, even if the /// paragraph spacing is larger. -/// +/// /// ### Example /// ``` /// The following theorem is diff --git a/src/geom/align.rs b/src/geom/align.rs index 25409e3a8..1e9bde522 100644 --- a/src/geom/align.rs +++ b/src/geom/align.rs @@ -45,7 +45,7 @@ impl Align { } /// Returns the position of this alignment in a container with the given - /// extentq. + /// extent. pub fn position(self, extent: Abs) -> Abs { match self { Self::Left | Self::Top => Abs::zero(),