Make reference to spreading in arguments of grid (#2593)

Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
KronosTheLate 2023-11-07 16:56:09 +01:00 committed by GitHub
parent 5f922abfd8
commit 3a1e47913d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,28 +36,39 @@ use super::Sizing;
/// instead of an array. For example, `columns:` `{3}` is equivalent to /// instead of an array. For example, `columns:` `{3}` is equivalent to
/// `columns:` `{(auto, auto, auto)}`. /// `columns:` `{(auto, auto, auto)}`.
/// ///
/// # Example /// # Examples
/// The example below demonstrates the different track sizing options.
///
/// ```example /// ```example
/// #set text(10pt, style: "italic") /// // We use `rect` to emphasize the
/// #let cell = rect.with( /// // area of cells.
/// #set rect(
/// inset: 8pt, /// inset: 8pt,
/// fill: rgb("e4e5ea"), /// fill: rgb("e4e5ea"),
/// width: 100%, /// width: 100%,
/// radius: 6pt
/// ) /// )
///
/// #grid( /// #grid(
/// columns: (60pt, 1fr, 60pt), /// columns: (60pt, 1fr, 2fr),
/// rows: (60pt, auto), /// rows: (auto, 60pt),
/// gutter: 3pt, /// gutter: 3pt,
/// cell(height: 100%)[Easy to learn], /// rect[Fixed width, auto height],
/// cell(height: 100%)[Great output], /// rect[1/3 of the remains],
/// cell(height: 100%)[Intuitive], /// rect[2/3 of the remains],
/// cell[Our best Typst yet], /// rect(height: 100%)[Fixed height],
/// cell[ /// image("tiger.jpg", height: 100%),
/// Responsive design in print /// image("tiger.jpg", height: 100%),
/// for everyone /// )
/// ], /// ```
/// cell[One more thing...], ///
/// You can also [spread]($arguments/#spreading) an array of strings or content
/// into a grid to populate its cells.
///
/// ```example
/// #grid(
/// columns: 5,
/// gutter: 5pt,
/// ..range(25).map(str)
/// ) /// )
/// ``` /// ```
#[elem(Layout)] #[elem(Layout)]