spruce/item
Pure bullet and ordered list rendering.
An Items value is a list of labelled entries rendered with an explicit
Spruce context. Bullet lists use a Unicode bullet (•) when the context
symbol mode is Unicode and a plain ASCII marker (-) when it is Ascii.
Ordered lists count from one at each nesting depth.
item.new()
|> item.kind(item.Ordered)
|> item.item("setup")
|> item.nested("build", item.new() |> item.item("erlang"))
|> item.render(context, _)
Types
Values
pub fn child(
items: Items,
label: String,
children: List(String),
) -> Items
Add a top-level item with one level of child labels.
pub fn enumerator(
items: Items,
enumerate: fn(Int, Int) -> String,
) -> Items
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.