The typed fences (
graph, sequence, steps) follow the shared rules for steps, meta strings, playback, and validation.
graph
Nodes and edges. Omitx/y and the layout places nodes for you: dagre for architecture and flow diagrams, layered for DAGs and trees, circular for small dense graphs. Refer to an edge as "from->to", or give it an id. Nodes take shapes such as person, cylinder, queue, and cloud, and groups draws labelled containers behind their members.
A bare graph fence renders when its body has nodes. Also spelled kiwi-graph, widget:graph.
All 34 keys
All 34 keys
sequence
A message sequence between participants: API flows, consensus rounds, handshakes, retries. Each playback step reveals one more message, sosteps only needs a note per message. frames draws grouping boxes such as alt [cache miss].
A bare sequence fence renders when its body has participants. Also spelled kiwi-sequence, widget:sequence, seq.
All 13 keys
All 13 keys
steps
A Mermaid diagram walked one step at a time. Each step canfocus or dim node ids and carry a note. For a sequenceDiagram, each step reveals one more message unless you set messages. Unlike other typed fences, each step stands alone instead of patching the previous one.
A steps fence needs a non-empty steps: list.
A bare steps fence renders when its body has diagram. Also spelled kiwi-steps, widget:steps, mermaid-steps.
All 6 keys
All 6 keys
mermaid
A standard```mermaid block renders as a diagram. Add focus= or dim= to the opening line to emphasize or fade node ids, and use Mermaid’s click directive to make a node open a page, a heading anchor, or an external URL.
mermaid block, or one whose first line isn’t a Mermaid diagram type such as flowchart, sequenceDiagram, or stateDiagram. To step through a Mermaid diagram, use steps.
d2
A```d2 block is rendered to SVG by the KiwiFS server, in-process, and follows the web UI’s light or dark theme.
- Layout.
dagreby default. Chooseelkwith D2’svars: {d2-config: {layout-engine: elk}}. Other engines aren’t available. - Limits. Source up to 64 KB, 10 seconds per render.
@importis disabled. - Errors. A diagram with a syntax error shows the source and D2’s message. If the server can’t render, for example a binary built with
-tags nod2, the source is shown as a code block.
/api/kiwi/render/d2, which you can also use directly:
Terminal
GET /api/kiwi/render/d2?source=...&theme=light works too. The response is image/svg+xml with an ETag, and errors are 422 (diagram error), 400 (empty or too large), 503 (timeout), or 501 (built without D2).
Drawing embeds
Embed an Excalidraw drawing (.excalidraw.md) or a canvas (.canvas.json) inline with a wiki embed. Add a width (wide, full), pin to keep it in view while the reader scrolls, a pixel size such as 600x400, or caption text after the |.
Related
Widgets overview
Fence names, steps, playback, and validation.
Canvas
Spatial diagrams in
.canvas.json files.Whiteboard
Freeform drawing in the web UI.
Data structures
tree, list, and map for structures, not architecture.