Make links to $grid in table docs more specific (#6776)

Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
This commit is contained in:
Y.D.X. 2025-08-23 00:40:58 +08:00 committed by GitHub
parent 206792bf38
commit 0b0c4cdb5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 12 deletions

View File

@ -36,7 +36,11 @@ use crate::visualize::{Paint, Stroke};
/// in the document flow. Set and show rules on one of these elements do not /// in the document flow. Set and show rules on one of these elements do not
/// affect the other. /// affect the other.
/// ///
/// # Sizing the tracks { #track-size }
///
/// A grid's sizing is determined by the track sizes specified in the arguments. /// A grid's sizing is determined by the track sizes specified in the arguments.
/// There are multiple sizing parameters: [`columns`]($grid.columns),
/// [`rows`]($grid.rows) and [`gutter`]($grid.gutter).
/// Because each of the sizing parameters accepts the same values, we will /// Because each of the sizing parameters accepts the same values, we will
/// explain them just once, here. Each sizing argument accepts an array of /// explain them just once, here. Each sizing argument accepts an array of
/// individual track sizes. A track size is either: /// individual track sizes. A track size is either:
@ -143,21 +147,26 @@ pub struct GridElem {
/// with that many `{auto}`-sized columns. Note that opposed to rows and /// with that many `{auto}`-sized columns. Note that opposed to rows and
/// gutters, providing a single track size will only ever create a single /// gutters, providing a single track size will only ever create a single
/// column. /// column.
///
/// See the [track size section](#track-size) above for more details.
pub columns: TrackSizings, pub columns: TrackSizings,
/// The row sizes. /// The row sizes.
/// ///
/// If there are more cells than fit the defined rows, the last row is /// If there are more cells than fit the defined rows, the last row is
/// repeated until there are no more cells. /// repeated until there are no more cells.
///
/// See the [track size section](#track-size) above for more details.
pub rows: TrackSizings, pub rows: TrackSizings,
/// The gaps between rows and columns. /// The gaps between rows and columns. This is a shorthand to set
/// [`column-gutter`]($grid.column-gutter) and [`row-gutter`]($grid.row-gutter)
/// to the same value.
/// ///
/// If there are more gutters than defined sizes, the last gutter is /// If there are more gutters than defined sizes, the last gutter is
/// repeated. /// repeated.
/// ///
/// This is a shorthand to set `column-gutter` and `row-gutter` to the same /// See the [track size section](#track-size) above for more details.
/// value.
#[external] #[external]
pub gutter: TrackSizings, pub gutter: TrackSizings,

View File

@ -22,8 +22,8 @@ use crate::visualize::{Paint, Stroke};
/// ///
/// Because tables are just grids with different defaults for some cell /// Because tables are just grids with different defaults for some cell
/// properties (notably `stroke` and `inset`), refer to the [grid /// properties (notably `stroke` and `inset`), refer to the [grid
/// documentation]($grid) for more information on how to size the table tracks /// documentation]($grid/#track-size) for more information on how to size the
/// and specify the cell appearance properties. /// table tracks and specify the cell appearance properties.
/// ///
/// If you are unsure whether you should be using a table or a grid, consider /// If you are unsure whether you should be using a table or a grid, consider
/// whether the content you are arranging semantically belongs together as a set /// whether the content you are arranging semantically belongs together as a set
@ -115,22 +115,22 @@ use crate::visualize::{Paint, Stroke};
/// ``` /// ```
#[elem(scope, LocalName, Figurable)] #[elem(scope, LocalName, Figurable)]
pub struct TableElem { pub struct TableElem {
/// The column sizes. See the [grid documentation]($grid) for more /// The column sizes. See the [grid documentation]($grid/#track-size) for
/// information on track sizing. /// more information on track sizing.
pub columns: TrackSizings, pub columns: TrackSizings,
/// The row sizes. See the [grid documentation]($grid) for more information /// The row sizes. See the [grid documentation]($grid/#track-size) for more
/// on track sizing. /// information on track sizing.
pub rows: TrackSizings, pub rows: TrackSizings,
/// The gaps between rows and columns. This is a shorthand for setting /// The gaps between rows and columns. This is a shorthand for setting
/// `column-gutter` and `row-gutter` to the same value. See the [grid /// `column-gutter` and `row-gutter` to the same value. See the [grid
/// documentation]($grid) for more information on gutters. /// documentation]($grid.gutter) for more information on gutters.
#[external] #[external]
pub gutter: TrackSizings, pub gutter: TrackSizings,
/// The gaps between columns. Takes precedence over `gutter`. See the /// The gaps between columns. Takes precedence over `gutter`. See the
/// [grid documentation]($grid) for more information on gutters. /// [grid documentation]($grid.gutter) for more information on gutters.
#[parse( #[parse(
let gutter = args.named("gutter")?; let gutter = args.named("gutter")?;
args.named("column-gutter")?.or_else(|| gutter.clone()) args.named("column-gutter")?.or_else(|| gutter.clone())
@ -138,7 +138,7 @@ pub struct TableElem {
pub column_gutter: TrackSizings, pub column_gutter: TrackSizings,
/// The gaps between rows. Takes precedence over `gutter`. See the /// The gaps between rows. Takes precedence over `gutter`. See the
/// [grid documentation]($grid) for more information on gutters. /// [grid documentation]($grid.gutter) for more information on gutters.
#[parse(args.named("row-gutter")?.or_else(|| gutter.clone()))] #[parse(args.named("row-gutter")?.or_else(|| gutter.clone()))]
pub row_gutter: TrackSizings, pub row_gutter: TrackSizings,