From b4b022940b908d8fe490b9f4f68bc60dcfb76cd2 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 19 Dec 2022 01:16:35 +0100 Subject: Syntax and example sections --- library/src/compute/calc.rs | 1 + library/src/compute/create.rs | 12 ++++++++++++ library/src/compute/utility.rs | 1 + 3 files changed, 14 insertions(+) (limited to 'library/src/compute') diff --git a/library/src/compute/calc.rs b/library/src/compute/calc.rs index eccc4531..1984d5ef 100644 --- a/library/src/compute/calc.rs +++ b/library/src/compute/calc.rs @@ -105,6 +105,7 @@ pub fn odd(args: &mut Args) -> SourceResult { /// # Parameters /// - dividend: ToMod (positional, required) /// The dividend of the modulus. +/// /// - divisor: ToMod (positional, required) /// The divisor of the modulus. /// diff --git a/library/src/compute/create.rs b/library/src/compute/create.rs index e3733d60..cb693a1c 100644 --- a/library/src/compute/create.rs +++ b/library/src/compute/create.rs @@ -77,12 +77,21 @@ pub fn luma(args: &mut Args) -> SourceResult { /// /// If this string is given, the individual components should not be given. /// +/// # Example +/// ``` +/// #let color = rgb("#239dad") +/// #text(16pt, color)[*Typst*] +/// ``` +/// /// - red: Component (positional) /// The red component. +/// /// - green: Component (positional) /// The green component. +/// /// - blue: Component (positional) /// The blue component. +/// /// - alpha: Component (positional) /// The alpha component. /// @@ -125,10 +134,13 @@ castable! { /// # Parameters /// - cyan: RatioComponent (positional, required) /// The cyan component. +/// /// - magenta: RatioComponent (positional, required) /// The magenta component. +/// /// - yellow: RatioComponent (positional, required) /// The yellow component. +/// /// - key: RatioComponent (positional, required) /// The key component. /// diff --git a/library/src/compute/utility.rs b/library/src/compute/utility.rs index bdad9618..ffad740e 100644 --- a/library/src/compute/utility.rs +++ b/library/src/compute/utility.rs @@ -22,6 +22,7 @@ pub fn lorem(args: &mut Args) -> SourceResult { /// # Parameters /// - pattern: NumberingPattern (positional, required) /// A string that defines how the numbering works. +/// /// - numbers: NonZeroUsize (positional, variadic) /// The numbers to apply the pattern to. /// -- cgit v1.2.3