summaryrefslogtreecommitdiff
path: root/library/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/layout')
-rw-r--r--library/src/layout/enum.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/library/src/layout/enum.rs b/library/src/layout/enum.rs
index 8814aba3..a0b23945 100644
--- a/library/src/layout/enum.rs
+++ b/library/src/layout/enum.rs
@@ -36,6 +36,17 @@ use super::GridLayouter;
/// + Don't forget step two
/// ```
///
+/// You can also use [`enum.item`]($func/enum.item) to programmatically
+/// customize the number of each item in the enumeration:
+///
+/// ```example
+/// #enum(
+/// enum.item(1)[First step],
+/// enum.item(5)[Fifth step],
+/// enum.item(10)[Tenth step]
+/// )
+/// ```
+///
/// ## Syntax
/// This functions also has dedicated syntax:
///
@@ -51,6 +62,10 @@ use super::GridLayouter;
/// Display: Numbered List
/// Category: layout
#[element(Layout)]
+#[scope(
+ scope.define("item", EnumItem::func());
+ scope
+)]
pub struct EnumElem {
/// If this is `{false}`, the items are spaced apart with
/// [enum spacing]($func/enum.spacing). If it is `{true}`, they use normal