spruce/list
Pure bullet and ordered list rendering.
Lists are rendered with an explicit Spruce context. Bullet lists use a
Unicode bullet when color is supported and a deterministic ASCII marker when
it is not. Ordered lists count from one at each nesting depth.
Types
The marker style used by the default enumerator.
pub type Kind {
Bullet
Ordered
}
Constructors
-
Bullet -
Ordered
Values
pub fn child(
list_: List,
label: String,
children: List(String),
) -> List
Add a top-level item with one level of child labels.
pub fn enumerator(
list_: List,
enumerate: fn(Int, Int) -> String,
) -> List
Set a custom enumerator.
The function receives the one-based item index within the current depth and the one-based depth of the item being rendered. It should return the complete marker to place before that item’s first label line.