From f88ef45ee6e285df59c7aa5cec935de331b4b6e0 Mon Sep 17 00:00:00 2001 From: Pg Biel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 3 May 2023 09:20:53 -0300 Subject: Function scopes (#1032) --- library/src/layout/enum.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'library/src/layout/enum.rs') 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 -- cgit v1.2.3