Improved docs for table/grid (#3615)

This commit is contained in:
Andrew Voynov 2024-03-11 16:33:15 +03:00 committed by GitHub
parent 515f5b6b4f
commit d01ccffad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 14 deletions

View File

@ -164,7 +164,7 @@ pub struct GridElem {
#[borrowed]
pub rows: TrackSizings,
/// The gaps between rows & columns.
/// The gaps between rows and columns.
///
/// If there are more gutters than defined sizes, the last gutter is repeated.
#[external]
@ -185,9 +185,9 @@ pub struct GridElem {
/// How to fill the cells.
///
/// This can be a color or a function that returns a color. The function is
/// passed the cells' column and row indices, starting at zero. This can be
/// used to implement striped grids.
/// This can be a color or a function that returns a color. The function
/// receives the cells' column and row indices, starting from zero. This can
/// be used to implement striped grids.
///
/// ```example
/// #grid(
@ -210,7 +210,7 @@ pub struct GridElem {
///
/// This can either be a single alignment, an array of alignments
/// (corresponding to each column) or a function that returns an alignment.
/// The function is passed the cells' column and row indices, starting at
/// The function receives the cells' column and row indices, starting from
/// zero. If set to `{auto}`, the outer alignment is used.
///
/// You can find an example for this argument at the

View File

@ -129,8 +129,8 @@ pub struct TableElem {
#[borrowed]
pub rows: TrackSizings,
/// The gaps between rows & columns. See the [grid documentation]($grid) for
/// more information on gutters.
/// The gaps between rows and columns. See the [grid documentation]($grid)
/// for more information on gutters.
#[external]
pub gutter: TrackSizings,
@ -151,13 +151,15 @@ pub struct TableElem {
/// How to fill the cells.
///
/// This can be a color or a function that returns a color. The function is
/// passed the cells' column and row indices, starting at zero. This can be
/// used to implement striped tables.
/// This can be a color or a function that returns a color. The function
/// receives the cells' column and row indices, starting from zero. This can
/// be used to implement striped tables.
///
/// ```example
/// #table(
/// fill: (col, _) => if calc.odd(col) { luma(240) } else { white },
/// fill: (col, _) =>
/// if calc.odd(col) { luma(240) }
/// else { white },
/// align: (col, row) =>
/// if row == 0 { center }
/// else if col == 0 { left }
@ -176,7 +178,7 @@ pub struct TableElem {
///
/// This can either be a single alignment, an array of alignments
/// (corresponding to each column) or a function that returns an alignment.
/// The function is passed the cells' column and row indices, starting at
/// The function receives the cells' column and row indices, starting from
/// zero. If set to `{auto}`, the outer alignment is used.
///
/// ```example
@ -683,8 +685,8 @@ pub struct TableVLine {
/// properties for a particular cell, or use it in show rules to apply certain
/// styles to multiple cells at once.
///
/// Perhaps the most important use-case of `{table.cell}` is to make a cell span
/// multiple columns or rows with the `colspan` and `rowspan` fields.
/// Perhaps the most important use case of `{table.cell}` is to make a cell span
/// multiple columns and/or rows with the `colspan` and `rowspan` fields.
///
/// ```example
/// >>> #set page(width: auto)