cat, git diffs, PDF export, search) it stays readable text, because the file holds data, not a program.
Most widgets are typed fences: a YAML body checked against a schema. KiwiFS rejects a broken one on write, renders it in the web UI, and steps through it on a playback clock that a reader can link to.
Catalog
Data structures
array
Arrays with pointers, spans, and dependency arrows.
matrix
DP tables, grids, heatmaps, adjacency matrices.
table
Named-column rows: schemas, lock tables, decision tables.
tree
BSTs, tries, heaps, union-find forests, B-tree pages.
list
Linked lists, including cycles and random pointers.
stack
LIFO stacks: call stacks, undo histories.
queue
FIFO queues and ring buffers.
map
Hash tables, probe paths, plain dictionaries.
bits
Bitmasks, flag registers, float layouts.
memory
Stack frames, heap objects, and the pointers between them.
Charts and plots
plot
x-y curves, formulas, shaded regions.
bars
Columns in value space: histograms, distributions.
numberline
One value axis: intervals, thresholds, SLOs.
plane
Coordinate geometry: points, polygons, vectors.
timeline
Spans in lanes with causal arrows.
kiwi-chart
Bar, line, area, pie, radar, and scatter charts from data or DQL.
kiwi-progress
Progress bars and gauges.
Diagrams
graph
Nodes and edges: architecture, state machines, DAGs.
sequence
Message flows between participants, one hop per step.
steps
A Mermaid diagram walked through one step at a time.
mermaid
Standard Mermaid diagrams with clickable nodes.
d2
D2 diagrams rendered to SVG by the server.
Drawing embeds
Excalidraw and canvas files embedded inline.
Interactive and learning
Quiz callouts
Six question types. Answer keys stay out of search.
kiwi-calc
Back-of-envelope math with tunable assumptions.
kiwi-playground
Sliders, toggles, and pickers that export a config.
kiwi-app
Sandboxed HTML, CSS, and JavaScript.
widget:live
React Live code with every widget view in scope.
widget:code
Runnable Python (Pyodide) or JavaScript.
Data and queries
kiwi-query
Live DQL results as a table or list.
kiwi-data
Structured records you can query with
FROM RECORDS.kiwi-kanban
Drag-and-drop boards from YAML or DQL.
widget:tracker
Per-reader progress across a curriculum.
Page structure
Callouts
> [!NOTE] and 26 other types, optionally foldable.Tabs and columns
:::tabs and :::columns container directives.Figures
Wide, full-width, or pinned media with captions.
Claims
Provenance badges, queryable with
FROM CLAIMS.kiwi-diff
Annotated side-by-side or unified diffs.
kiwi-color
Color swatches with contrast ratios.
Fence names
Each typed fence answers to three spellings, plus any aliases listed in its reference entry:
The marker-key rule means a vault that already uses
```tree for directory listings, or ```table for pipe tables, keeps its code blocks. To turn bare names off for a workspace, or allow only some:
.kiwi/config.toml
kiwi- and widget: spellings keep working either way.
Writing a typed fence
The YAML body’s top-level keys are the widget’s properties. Each fence’s reference entry lists them, for example the array keys.Steps
An optionalsteps: list turns the widget into a walkthrough. Each step is a shallow patch over the previous step, so you write only what changes. Use frames: instead when you want each entry applied over the base. A fence uses one or the other, not both.
A step can also carry these keys, which are not widget properties:
A step can also be a bare string, which is a
note over unchanged properties. The steps fence is the exception to the patch rule: each of its steps stands alone.
Other reserved top-level keys:
A property marked Fixed across steps in a key table can only be set at the top level. Setting it inside a step is a lint error.
Meta string
Options after the fence name on the opening line:Playback
A widget with steps gets playback controls: play and pause, step back and forward, a speed toggle (1x, 2x, 4x), Copy link to this step, and Download this step as an image. With the widget focused, Space plays or pauses, the arrow keys step, and R resets. The current step lives in the URL fragment, so you can link a reader to one moment:#?step.<id>=Ntargets the widget or clock named<id>.#?step=Ntargets the first unnamed widget on the page.
clock= and one set of controls drives them all. A shorter member holds its last frame while longer ones keep going.
Validation
KiwiFS validates typed fences against the same schema the web UI renders from.- On write. Writes through KiwiFS run the markdown linter. With
[lint] reject_errorson (the default), a page with any error-severity issue is rejected. Errors include broken YAML in a strict fence, a wrong value type, a missing required key, and setting a fixed property inside a step. An unknown key is a warning that suggests the closest valid key. - Nothing to draw. A strict
kiwi-array,kiwi-matrix,kiwi-tree,kiwi-memory,kiwi-numberline, orkiwi-tablefence with none of its data keys is an error, for examplekiwi-array fence: needs one of "values", "rows". A data key introduced in the first step counts. - Bare names are lenient. A bare tag whose YAML doesn’t parse gets a warning, not an error, and only when the body plainly looks like that widget.
- In the web UI. A fence with errors shows its source with the problems listed, instead of a broken picture.
- CLI
- REST
- MCP
Terminal
Reference for agents and scripts
The fence catalog is available wherever you write pages:- CLI
- MCP
Terminal
kiwifs widgets suggest [path] scans for widget:live blocks that only call a view component, and prints the typed fence each could become. It never rewrites files. Without a path it scans --root (default ./knowledge).Search and export
Search indexes a typed fence’s title, caption, step notes, code listing, and short labels such as node names, not its coordinates. Document export (PDF and other formats) replaces each typed fence with its caption and step notes as a blockquote, followed by the YAML, so a printed page stays readable.Related
DQL
The query language behind
kiwi-query, kiwi-chart, and FROM RECORDS.Web UI
Where widgets render, and the editor that writes them.
Canvas
Spatial diagrams in
.canvas.json files.MCP
kiwi_widget_reference, kiwi_lint, and kiwi_quiz for agents.