diff options
| author | Pg Biel <9021226+PgBiel@users.noreply.github.com> | 2023-05-03 09:20:53 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-03 14:20:53 +0200 |
| commit | f88ef45ee6e285df59c7aa5cec935de331b4b6e0 (patch) | |
| tree | eab5481d4b50d1d57adb4d122d7fa023dee2dcec /library/src/layout/enum.rs | |
| parent | db6a710638cf26ddcd09b8fba74b9d1caf6cb4b8 (diff) | |
Function scopes (#1032)
Diffstat (limited to 'library/src/layout/enum.rs')
| -rw-r--r-- | library/src/layout/enum.rs | 15 |
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 |
