diff options
Diffstat (limited to 'crates/typst-library/src/layout/grid/mod.rs')
| -rw-r--r-- | crates/typst-library/src/layout/grid/mod.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/typst-library/src/layout/grid/mod.rs b/crates/typst-library/src/layout/grid/mod.rs index 369df11e..52621c64 100644 --- a/crates/typst-library/src/layout/grid/mod.rs +++ b/crates/typst-library/src/layout/grid/mod.rs @@ -1,6 +1,6 @@ pub mod resolve; -use std::num::NonZeroUsize; +use std::num::{NonZeroU32, NonZeroUsize}; use std::sync::Arc; use comemo::Track; @@ -468,6 +468,17 @@ pub struct GridHeader { #[default(true)] pub repeat: bool, + /// The level of the header. Must not be zero. + /// + /// This allows repeating multiple headers at once. Headers with different + /// levels can repeat together, as long as they have ascending levels. + /// + /// Notably, when a header with a lower level starts repeating, all higher + /// or equal level headers stop repeating (they are "replaced" by the new + /// header). + #[default(NonZeroU32::ONE)] + pub level: NonZeroU32, + /// The cells and lines within the header. #[variadic] pub children: Vec<GridItem>, |
