list / li

A list holds li items. It's a bullet list by default; set style = :numbered for a numbered one. Each li's text runs through the inline-pattern engine, so bold, code, links, and icons all work inside items. See formatting.

Preview

  • Plain item
  • With bold and a link
  1. First step
  2. Second step
  • Plain item
  • With bold and a link
  1. First step
  2. Second step

Example

list {
  li "Plain item"
  li "With **bold** and a [link](concept_overview)"
}
list {
  style = :numbered
  li "First step"
  li "Second step"
}
PropertyTypeRequiredDescription
ididentifiernoOptional explicit HTML id.
classlist<utf8>noOptional style classes.
styleListStyleno:bullet (default → <ul>) or :numbered (→ <ol>).

Child blocks

SlotAcceptsMultipleDescription
itemsliyesThe list items.

An li is one list item. Nest an li inside an li for a sublist, or drop a whole list block inside it for a sublist with a different style.

PropertyTypeRequiredDescription
textutf8yesItem text (the inline label); inline patterns apply.
ididentifiernoOptional explicit HTML id.
classlist<utf8>noOptional style classes.

Child blocks

SlotAcceptsMultipleDescription
childrenListNodeyesNested lis (a sublist), or a whole list block for a different style.

§ 1Nesting

Nest an li inside an li for a sublist — it inherits the parent list's style, so a numbered list numbers sublists hierarchically (2.1, 2.2). For a sublist with a different style, drop a whole list block inside the li instead.

Preview

  1. Setup
  2. Build
    1. Compile
    2. Link
  3. Run
    • Foreground
    • Background
  1. Setup
  2. Build
    1. Compile
    2. Link
  3. Run
    • Foreground
    • Background

Example

list {
  style = :numbered
  li "Setup"
  li "Build" {
    li "Compile"  # renders 2.1
    li "Link"  # renders 2.2
  }
  li "Run" {
    list {
      # a bulleted sublist inside a numbered list
      li "Foreground"
      li "Background"
    }
  }
}