mirror of
https://github.com/typst/typst
synced 2025-05-15 01:25:28 +08:00
Documentation improvements (#3698)
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
This commit is contained in:
parent
9dfc54d726
commit
c125125080
@ -223,8 +223,11 @@ impl Array {
|
|||||||
self.0.pop().ok_or_else(array_is_empty)
|
self.0.pop().ok_or_else(array_is_empty)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inserts a value into the array at the specified index. Fails with an
|
/// Inserts a value into the array at the specified index, shifting all
|
||||||
/// error if the index is out of bounds.
|
/// subsequent elements to the right. Fails with an error if the index is
|
||||||
|
/// out of bounds.
|
||||||
|
///
|
||||||
|
/// To replace an element of an array, use [`at`]($array.at).
|
||||||
#[func]
|
#[func]
|
||||||
pub fn insert(
|
pub fn insert(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -701,22 +701,22 @@ pub struct GridVLine {
|
|||||||
///
|
///
|
||||||
/// #grid(
|
/// #grid(
|
||||||
/// fill: (x, y) => rgb(
|
/// fill: (x, y) => rgb(
|
||||||
/// if calc.odd(x + y) { "EFF0F3" }
|
/// if calc.odd(x + y) { "7F8396" }
|
||||||
/// else { "7F8396" }
|
/// else { "EFF0F3" }
|
||||||
/// ),
|
/// ),
|
||||||
/// columns: (1em,) * 8,
|
/// columns: (1em,) * 8,
|
||||||
/// rows: 1em,
|
/// rows: 1em,
|
||||||
/// align: center + horizon,
|
/// align: center + horizon,
|
||||||
///
|
///
|
||||||
/// [♜], [♞], [♝], [♛], [♚], [♝], [♞], [♜],
|
/// [♖], [♘], [♗], [♕], [♔], [♗], [♘], [♖],
|
||||||
/// [♟], [♟], [♟], [♟], [], [♟], [♟], [♟],
|
/// [♙], [♙], [♙], [♙], [], [♙], [♙], [♙],
|
||||||
/// grid.cell(
|
/// grid.cell(
|
||||||
/// x: 4, y: 3,
|
/// x: 4, y: 3,
|
||||||
/// stroke: blue.transparentize(60%)
|
/// stroke: blue.transparentize(60%)
|
||||||
/// )[♟],
|
/// )[♙],
|
||||||
///
|
///
|
||||||
/// ..(grid.cell(y: 6)[♙],) * 8,
|
/// ..(grid.cell(y: 6)[♟],) * 8,
|
||||||
/// ..([♖], [♘], [♗], [♕], [♔], [♗], [♘], [♖])
|
/// ..([♜], [♞], [♝], [♛], [♚], [♝], [♞], [♜])
|
||||||
/// .map(grid.cell.with(y: 7)),
|
/// .map(grid.cell.with(y: 7)),
|
||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user