summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorMalo <57839069+MDLC01@users.noreply.github.com>2024-03-19 10:37:16 +0100
committerGitHub <noreply@github.com>2024-03-19 09:37:16 +0000
commitc125125080b00d63c370d72c4fe6229d511f0c89 (patch)
tree1f150a135c5d944bea00964c9a8f09bc4415d366 /crates
parent9dfc54d726911422a1460159769823a0b21bcbf0 (diff)
Documentation improvements (#3698)
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/foundations/array.rs7
-rw-r--r--crates/typst/src/layout/grid/mod.rs14
2 files changed, 12 insertions, 9 deletions
diff --git a/crates/typst/src/foundations/array.rs b/crates/typst/src/foundations/array.rs
index 8f5703bb..4c05e375 100644
--- a/crates/typst/src/foundations/array.rs
+++ b/crates/typst/src/foundations/array.rs
@@ -223,8 +223,11 @@ impl Array {
self.0.pop().ok_or_else(array_is_empty)
}
- /// Inserts a value into the array at the specified index. Fails with an
- /// error if the index is out of bounds.
+ /// Inserts a value into the array at the specified index, shifting all
+ /// 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]
pub fn insert(
&mut self,
diff --git a/crates/typst/src/layout/grid/mod.rs b/crates/typst/src/layout/grid/mod.rs
index 30507e7b..bdc1ff44 100644
--- a/crates/typst/src/layout/grid/mod.rs
+++ b/crates/typst/src/layout/grid/mod.rs
@@ -701,22 +701,22 @@ pub struct GridVLine {
///
/// #grid(
/// fill: (x, y) => rgb(
-/// if calc.odd(x + y) { "EFF0F3" }
-/// else { "7F8396" }
+/// if calc.odd(x + y) { "7F8396" }
+/// else { "EFF0F3" }
/// ),
/// columns: (1em,) * 8,
/// rows: 1em,
/// align: center + horizon,
///
-/// [♜], [♞], [♝], [♛], [♚], [♝], [♞], [♜],
-/// [♟], [♟], [♟], [♟], [], [♟], [♟], [♟],
+/// [♖], [♘], [♗], [♕], [♔], [♗], [♘], [♖],
+/// [♙], [♙], [♙], [♙], [], [♙], [♙], [♙],
/// grid.cell(
/// x: 4, y: 3,
/// stroke: blue.transparentize(60%)
-/// )[♟],
+/// )[♙],
///
-/// ..(grid.cell(y: 6)[♙],) * 8,
-/// ..([♖], [♘], [♗], [♕], [♔], [♗], [♘], [♖])
+/// ..(grid.cell(y: 6)[♟],) * 8,
+/// ..([♜], [♞], [♝], [♛], [♚], [♝], [♞], [♜])
/// .map(grid.cell.with(y: 7)),
/// )
/// ```