4. Tables and lists

Pipe-row tables and nestable lists — with inline patterns inside every cell and item.

After this lesson you can

- Author a table with WCL's native pipe-row syntax - Build bulleted and numbered lists and nest sublists

Before you start: Formatting, callouts, and columns

A table { rows: | … | } uses WCL's pipe-row syntax: the first row becomes the header, the rest the body. Cells are expressions — utf8 cells run through the inline-pattern engine, so bold, links, and icons work inside them; numbers and booleans stringify.

A list holds li items and is bulleted by default; style = :numbered numbers it. Nest an li inside an li for a sublist that inherits the style (numbered lists number hierarchically: 2.1, 2.2); drop a whole list block inside an li for a sublist with a different style.

§ 1Exercise: A roster and a runbook

Add a table with a formatted cell and a numbered list with a nested sublist.

wcl
page roster { sites = [:docs]
  h1 "Roster"
  table {
    rows:
      | "Name"  | "Role"    | "Years" |
      | "Alice" | "**Dev**" | 3       |
      | "Bob"   | "_Ops_"   | 5       |
  }
  list { style = :numbered
    li "Setup"
    li "Build" {
      li "Compile"
      li "Link"
    }
  }
}

Expected result

The table renders with a header row and a bold Dev cell, and the list numbers the sublist hierarchically (2.1, 2.2).

Hint

A literal pipe inside an unquoted cell splits the row — wrap any cell containing a pipe in a string literal.