collections
what a query can ask a note for. each collection is a list of records, and each record a set of fields. back to the book
name a collection in a query, filter it and pick fields, the same language a note writes: xmd weekend.x.md 'tasks | filter(fn(t) => !t.done) | map(.title)' for one note, --workspace for every note in a folder. a feature module reads the same collections through its inputs. why xmd exists shows more. the examples below run on the examples
every record
most records have these fields, and each collection below adds its own
| field | what it is |
|---|---|
anchor | the LSP position at the end of its line, where your editor draws its result |
errors | List of Text: what went wrong with it, empty when nothing did |
kind | Text: what the record is, the collection's name in the singular: task, value, section |
line | Number: the zero-based line it is on |
source | Record: where it is: path, uri, line (one-based) and range |
title | Text: a short label for it, as a list of records shows it |
values and calculations
What a note defines and computes.
values
Every definition in a note: a value with a name written in a sentence, $3,000:budget, or a calculation, total := car + $90.
xmd 01-values.x.md 'values | map(.{name, display})'
display=$3,000 name=budget
display=$2,444 name=spent
display=$556 name=remaining
| field | what it is |
|---|---|
computed | Boolean: whether it is calculated, rather than written as a value |
display | Text: its value as the note shows it inline, $1,324 |
end_line | Number: one past its last line, the lines it holds included |
expression | Text: the expression as written |
form | Text or Null: the form its definition calls, maximize, minimize or solve |
grid | List of {line, cells, text}: the table under it, each line as written, header and divider included |
header | Number or Null: the line of that table's header |
hover | Text: the Markdown your editor shows when you hover it |
name | Text or Null: the name it was given, budget in $3,000:budget |
problems | List: what is wrong with that table, like a missing cell or a bad name |
record | Record or Null: everything a form worked out, for a definition that calls one |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | what it evaluates to, typed: money, a date, a duration, a list; null when it fails |
calculations
Every expression a sentence puts in square brackets, [total] or [each * 3].
xmd 01-values.x.md 'calculations | map(.{expression, display})'
display=18.5333% expression=remaining / budget
| field | what it is |
|---|---|
bracketed | Boolean: whether it is written in square brackets in a sentence, [total] |
display | Text: its value as the note shows it inline, $1,324 |
expression | Text: the expression as written |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | what it evaluates to, typed: money, a date, a duration, a list; null when it fails |
references
Every place an expression reads a name, with the value it reads there.
xmd 10-timers.x.md 'references | map(.{name, property, display})'
display=25m name=focus property=remaining
display=0s name=work property=elapsed
| field | what it is |
|---|---|
display | Text: its value as the note shows it inline, $1,324 |
expression | Text: the expression as written |
hover | Text: the expression as written, which your editor's hover starts from |
name | Text: the name it reads |
property | Text or Null: the field it reads, remaining in focus.remaining |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | what it evaluates to, typed: money, a date, a duration, a list; null when it fails |
mentions
Every place a note names something: each definition's name and each name it reads, in a sentence or in an expression.
xmd 01-values.x.md 'mentions | filter(fn(m) => m.name == "budget") | map(.{line, bracket})'
bracket=false line=4
bracket=false line=6
| field | what it is |
|---|---|
bracket | Boolean: whether it is in square brackets in a sentence |
hover | Text: the Markdown your editor shows when you hover it |
name | Text: the name |
property | Text or Null: the field it reads, remaining in focus.remaining |
tables and plans
Tables with a name, their rows and cells, and the plans that choose values for them.
tables
Every table with a name: groceries := table and the table under it.
xmd 11-tables.x.md 'tables | map(.{name, display})'
display=2 rows · 3 columns name=groceries
| field | what it is |
|---|---|
computed | Boolean: whether it is calculated, rather than written as a value |
display | Text: its value as the note shows it inline, $1,324 |
end_line | Number: one past its last line, the lines it holds included |
expression | Text: the expression as written |
form | Text or Null: the form its definition calls, maximize, minimize or solve |
grid | List of {line, cells, text}: the table under it, each line as written, header and divider included |
header | Number or Null: the line of that table's header |
hover | Text: the Markdown your editor shows when you hover it |
name | Text or Null: the name it was given, budget in $3,000:budget |
problems | List: what is wrong with that table, like a missing cell or a bad name |
record | Record or Null: everything a form worked out, for a definition that calls one |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | List of Record: its rows, each cell by its column's name |
rows
Every row of a table with a name.
xmd 11-tables.x.md 'rows | map(.cells)'
item=apple price=$3.30 quantity=2
item=pear price=$4.30 quantity=4
| field | what it is |
|---|---|
cells | Record: the row's cells by column name, each evaluated |
table | Text: the name of its table |
cells
Every cell of a table with a name.
xmd 12-calculated-cells.x.md 'cells | filter(fn(c) => c.computed) | map(.{column, row, display})'
column=quantity display=6 row=0
column=cost display=$1.50 row=0
column=cost display=$4.50 row=1
| field | what it is |
|---|---|
column | Text: its column's header |
computed | Boolean: whether it is a calculation in brackets, [unit_price * 3] |
display | Text: its value as the note shows it inline, $1,324 |
expression | Text: the expression as written |
row | Number: its row, from 0 |
table | Text: the name of its table |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | what it evaluates to, typed: money, a date, a duration, a list; null when it fails |
plans
Every definition that calls maximize or minimize, with the values it chose.
xmd 14-plans.x.md 'plans | map(.{name, display})'
display=$94.75 name=bakery
| field | what it is |
|---|---|
computed | Boolean: whether it is calculated, rather than written as a value |
display | Text: its value as the note shows it inline, $1,324 |
end_line | Number: one past its last line, the lines it holds included |
expression | Text: the expression as written |
grid | List of {line, cells, text}: the table under it, each line as written, header and divider included |
header | Number or Null: the line of that table's header |
hover | Text: the Markdown your editor shows when you hover it |
name | Text or Null: the name it was given, budget in $3,000:budget |
problems | List: what is wrong with that table, like a missing cell or a bad name |
solution | Record: the solved plan: each unknown, the objective, and each constraint and whether it binds |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | Record: each unknown it solved for, by name, and objective, the best the objective can be |
forms
Every definition that calls a form a module declares, like maximize, minimize and solve.
xmd 16-goal-seek.x.md 'forms | map(.{name, form, display})'
display=$422.22 form=solve name=monthly
| field | what it is |
|---|---|
computed | Boolean: whether it is calculated, rather than written as a value |
display | Text: its value as the note shows it inline, $1,324 |
end_line | Number: one past its last line, the lines it holds included |
expression | Text: the expression as written |
form | Text or Null: the form its definition calls, maximize, minimize or solve |
grid | List of {line, cells, text}: the table under it, each line as written, header and divider included |
header | Number or Null: the line of that table's header |
hover | Text: the Markdown your editor shows when you hover it |
name | Text or Null: the name it was given, budget in $3,000:budget |
problems | List: what is wrong with that table, like a missing cell or a bad name |
record | Record or Null: everything a form worked out, for a definition that calls one |
type | Text: the kind of its value: Money, Date, Table, Plan |
value | what it evaluates to, typed: money, a date, a duration, a list; null when it fails |
decisions
Every decision cell of a plan's table: one in a name? column (yes or no) or a name# column (how many).
xmd 15-decision-columns.x.md 'decisions | map(.{line, value})'
line=7 value=true
line=8 value=true
line=9 value=true
line=10 value=false
| field | what it is |
|---|---|
plan | Text: the name of the plan that decides it |
title | Text: the name of the plan that decides it |
value | Boolean or Number: what the plan chose |
tasks and time
Checklists and tasks, and everything with a place in time.
tasks
Every task: a checklist item, - [ ] Pack, with its attributes worked out.
xmd 06-task-attributes.x.md 'tasks | filter(fn(t) => !t.done) | map(.{title, due, blocked_by})'
blocked_by=[] due=2026-10-15 title=Renew passport
blocked_by=[] due=2026-10-10 title=Book flights
blocked_by=[] due=null title=Pay the deposit
blocked_by=["deposit"] due=null title=Confirm the booking
blocked_by=[] due=2026-09-20 title=Water the plants
| field | what it is |
|---|---|
at | Date or DateTime: when it happens, from @at or an itinerary's time, or null |
at_date | Date: the day of at, or null |
attributes | Record: each attribute it writes, as written, by key: {due: "2026-10-15"} |
blocked_by | List of Text: what its @after still waits on, as written |
blocked_error | Text or Null: why its @after could not be read |
blockers | List of {name, source}: the named items its @after still waits on |
checked | Boolean: whether its own box is ticked, [x]. done also counts its subtasks |
children | List of {line, done}: its subtasks |
done | Boolean: whether it is complete; an item with subitems is complete when every one is |
due | Date or DateTime: from @due; a task with @every and no @due is due today |
estimate | Duration: from @estimate, or null |
hover | Text: the Markdown your editor shows when you hover it |
in_progress | Boolean: started but not done: marked [-], or some of its subtasks done |
leaf | Boolean: whether it has no subtasks of its own. Only leaves join entries |
name | Text or Null: the name it was given, budget in $3,000:budget |
parent | Record or Null: the item it nests under, as path, uri, line and range |
schedule | List of {key, value, error}: its @due, @scheduled and @at, in the order written |
scheduled | Date or DateTime: from @scheduled, or null |
tags | List of Text: its #tags and @tags |
timer | Timer or Null: the timer its @timer names |
checkboxes
Every list item with a checkbox, as the language reads it before the tasks module makes tasks of them. A named item is a Boolean, whether it is done, and a named heading is the checklist of the items under it.
xmd 05-checklists.x.md 'checkboxes | map(.{title, mark, done})'
done=true mark=done title=Draft the announcement
done=true mark=done title=Collect screenshots
done=false mark=open title=Record the demo
done=true mark=done title=Write the script
done=false mark=open title=Capture the recording
done=false mark=in_progress title=Update the changelog
| field | what it is |
|---|---|
attributes | Record: each attribute it writes, as written, by key: {due: "2026-10-15"} |
checkbox | the LSP range of its [ ] |
children | List of Number: the lines of the items nested under it |
done | Boolean: checked, or every subitem done when it has some |
hover | Text: the Markdown your editor shows when you hover it |
indent | Number: its indentation in bytes |
mark | open, in_progress or done: what its checkbox says |
name | Text or Null: its trailing :name |
name_range | the LSP range of its name, or null |
parent | Number or Null: the line of the item it nests under, the nearest one indented less, until a heading |
range | the LSP range of the line's text, the blanks around it aside |
title | Text: its text past the checkbox, up to its first attribute or trailing :name, trimmed |
attributed
Every line that writes an attribute a module declares, tasks included, with each attribute evaluated for the request's day.
xmd 09-appointments.x.md 'attributed | map(.{title, task})'
task=false title=Dentist
task=false title=Team lunch
| field | what it is |
|---|---|
attributes | Record: each attribute the line writes, by key, as {text, value, date, error, range, value_range}: text as written, value evaluated (null when it fails), date its calendar day when it is a date or time, error why it failed or null, and the LSP ranges of the whole @key(value) and of the value |
block | item, prose or row |
range | the LSP range of the line's text, the blanks around it aside |
task | Boolean: whether the line is a task |
title | Text: the line's text from where it starts (past a list marker and any checkbox) up to its first attribute, trimmed |
entries
Everything with a place on a timeline: leaf tasks, appointments and itinerary stops, together.
xmd 09-appointments.x.md 'entries | map(.{kind, title, at})'
at=2026-09-18 kind=event title=Dentist
at=2026-09-17 kind=event title=Team lunch
| field | what it is |
|---|---|
at | Date or DateTime: when it happens, from @at or an itinerary's time, or null |
at_date | Date: the day of at, or null |
attributes | Record: each attribute it writes, as written, by key: {due: "2026-10-15"} |
blocked_by | List of Text: what its @after still waits on, as written |
blocked_error | Text or Null: why its @after could not be read |
blockers | List of {name, source}: the named items its @after still waits on |
checked | Boolean: whether its own box is ticked, [x]. done also counts its subtasks |
children | List of {line, done}: its subtasks |
done | Boolean: whether it is complete; an item with subitems is complete when every one is |
due | Date or DateTime: from @due; a task with @every and no @due is due today |
estimate | Duration: from @estimate, or null |
hover | Text: the Markdown your editor shows when you hover it |
in_progress | Boolean: started but not done: marked [-], or some of its subtasks done |
leaf | Boolean: whether it has no subtasks of its own. Only leaves join entries |
name | Text or Null: the name it was given, budget in $3,000:budget |
parent | Record or Null: the item it nests under, as path, uri, line and range |
schedule | List of {key, value, error}: its @due, @scheduled and @at, in the order written |
scheduled | Date or DateTime: from @scheduled, or null |
tags | List of Text: its #tags and @tags |
timer | Timer or Null: the timer its @timer names |
events
Every appointment: a line with @at that is not a task.
xmd 09-appointments.x.md 'events | map(.{title, at})'
at=2026-09-18 title=Dentist
at=2026-09-17 title=Team lunch
| field | what it is |
|---|---|
at | Date or DateTime: when it happens, from @at or an itinerary's time, or null |
at_date | Date: the day of at, or null |
blocked_by | List of Text: what its @after still waits on, as written |
done | Boolean: whether it is complete; an item with subitems is complete when every one is |
due | Date or DateTime: from @due; a task with @every and no @due is due today |
estimate | Duration: from @estimate, or null |
leaf | Boolean: whether it has no subtasks of its own. Only leaves join entries |
parent | Record or Null: the item it nests under, as path, uri, line and range |
scheduled | Date or DateTime: from @scheduled, or null |
tags | List of Text: its #tags and @tags |
stops
Every stop of an itinerary: a timed line under a day heading.
xmd 17-itinerary.x.md 'stops | map(.{title, at}) | slice(0, 3)'
at=2026-11-20 07:04:00 -04:00 title=> Depart JFK for MEX on AM 405
at=2026-11-20 11:55:00 -04:00 title=< Arrive at MEX
at=2026-11-20 14:45:00 -04:00 title=> Depart MEX for OAX on AM 1050
| field | what it is |
|---|---|
at | Date or DateTime: when it happens, from @at or an itinerary's time, or null |
at_date | Date: the day of at, or null |
blocked_by | List of Text: what its @after still waits on, as written |
done | Boolean: whether it is complete; an item with subitems is complete when every one is |
due | Date or DateTime: from @due; a task with @every and no @due is due today |
estimate | Duration: from @estimate, or null |
leaf | Boolean: whether it has no subtasks of its own. Only leaves join entries |
parent | Record or Null: the item it nests under, as path, uri, line and range |
scheduled | Date or DateTime: from @scheduled, or null |
tags | List of Text: its #tags and @tags |
days
Every day heading of an itinerary, ## Friday, November 20.
xmd 17-itinerary.x.md 'days | map(.title)'
## Friday, November 20, 2026 · New York | Oaxaca
## Saturday, November 21 · Oaxaca
| field | what it is |
|---|---|
value | Record: the day as read: its day, month, year and weekday, its places, its stops, and the forecast for it once one is fetched |
timers
Every timer: a countdown or stopwatch definition, and every name that reads one.
xmd 10-timers.x.md 'timers | map(.{name, state: .value.state})'
name=focus state=idle
name=work state=idle
name=focus state=idle
name=work state=idle
name=focus state=idle
name=work state=idle
| field | what it is |
|---|---|
definition | Boolean: whether this is where the timer is defined, rather than read |
hover | Text: the Markdown your editor shows when you hover it |
inlay | Boolean: whether your editor draws the timer's state here |
name | Text: the timer's name |
origin | Record: the document and name of the definition it belongs to |
value | Record: its state: state (idle, running or paused), running, elapsed, duration, remaining for a countdown, and when it started |
links
Links in notes, and what is known about what they point at.
links
Every link in a note: urls, geo: places and paths to files.
xmd 18-links-and-files.x.md 'links | map(.url)'
https://zed.dev
geo:17.0654,-96.7236
./assets/sample-receipt.svg
./assets/sample-receipt.svg
| field | what it is |
|---|---|
url | Text: the target as written |
resources
Every target a link points at, with what a refresh last fetched about it.
xmd 18-links-and-files.x.md 'resources | map(.{target, metadata})'
metadata=null target=https://zed.dev
metadata=null target=geo:17.0654,-96.7236
metadata=null target=./assets/sample-receipt.svg
metadata=null target=./assets/sample-receipt.svg
metadata=null target=https://zed.dev
metadata=null target=geo:17.0654,-96.7236
metadata=null target=./assets/sample-receipt.svg
| field | what it is |
|---|---|
metadata | Record or Null: what a refresh last fetched about it, like a pull request's state; null before one |
target | Text: the url, place or path |
notes and their parts
The notes themselves, their headings, and what modules recognize and report in them.
notes
Every note in the workspace.
xmd --workspace 'notes | map(.title) | slice(0, 3)'
01-values.x.md
02-calculations.x.md
03-types.x.md
| field | what it is |
|---|---|
text | Text: the whole note as written |
title | Text: its file name |
sections
Every heading, with the lines under it.
xmd 05-checklists.x.md 'sections | map(.{title, level, line})'
level=1 line=0 title=Checklists
level=2 line=2 title=Launch
| field | what it is |
|---|---|
end_line | Number: one past its last line, the lines it holds included |
level | Number: 1 for #, 2 for ##, and so on |
title | Text: the heading's text past its #s |
recognized
Every match of a recognizer a module declares. A feature module that names it in inputs reads only its own recognizers' matches.
xmd 17-itinerary.x.md 'recognized | map(.{recognizer, text}) | slice(0, 3)'
recognizer=day text=## Friday, November 20, 2026 · New York | Oaxaca
recognizer=stop text=07:04 AM > Depart JFK for MEX on AM 405
recognizer=detail text= Seats: 22B, 22C
| field | what it is |
|---|---|
anchor | the LSP position just past the match, where an inlay goes |
end_line | Number: one past its last line, the lines it holds included |
groups | Record: each named group that took part, as {text, range}, with term (Text or Null) when the recognizer declares terms for it |
module | Text: the id of the module that declared it |
parent | Number or Null: the line of the match it is under |
range | the match's LSP range |
recognizer | Text: the recognizer's name |
text | Text: the matched text |
title | Text: the matched text |
diagnostics
Every problem in a note, as your editor underlines it.
printf 'total := price * 2\n' | xmd 'diagnostics | map(.{severity, message})'
message=Unknown name 'price' severity=error
| field | what it is |
|---|---|
code | Text: what kind of problem it is, like name, property or module |
message | Text: what is wrong |
severity | error, warning, information or hint |
inspecting a note
How xmd reads a note, for tools and for debugging. xmd ast and xmd graph print these for one note.
ast
Every node of a note's syntax tree, from the document down to each literal.
xmd 02-calculations.x.md 'ast | filter(fn(n) => n.kind == "definition") | map(.{name, text})'
name=units text=12:units
name=unit_price text=$8.50:unit_price
name=subtotal text=subtotal := units * unit_price
name=tax text=tax := subtotal * 8.875%
name=total text=total := subtotal + tax
| field | what it is |
|---|---|
bracketed | Boolean: whether it is written in square brackets in a sentence, [total] |
checked | Boolean: whether a checkbox is ticked |
children | List of Text: the ids of the nodes in it |
column | Number: a cell's column, from 0 |
computed | Boolean: whether it is calculated, rather than written as a value |
domain | Text: a decision column's domain, Choice or Count |
form | Text or Null: the form its definition calls, maximize, minimize or solve |
groups | Record: a recognized match's named groups, as text |
hover | Text: the Markdown your editor shows when you hover it |
id | Text: the node's id, unique in the workspace |
index | Number: a row's or a column's position, from 0 |
kind | Text: the node's kind: document, section, line, definition, binary, call, literal and more |
level | Number: a section's heading level |
module | Text: the module whose recognizer matched |
name | Text: the name it defines or reads |
operator | Text: a binary or unary operator |
parameters | List of Text: a function's parameters |
parent | Text or Null: the id of the node it is in |
property | Text or Null: the field it reads, remaining in focus.remaining |
role | Text: what it is to its parent: expression, left, right, argument and more |
schemaVersion | Number: the version of the format, which changes when a field does |
state | Text: a checkbox's mark: open, in_progress or done |
target | Text: a link's target |
text | Text: the source it covers |
title | Text: a section's heading, or a task's or line's text |
type | Text: a column's type |
value | a literal's or an attribute's value |
graph
How a note's values depend on each other: one record per note, with its nodes and the edges between them.
xmd 02-calculations.x.md 'graph.nodes | map(.{kind, name})'
kind=definition name=units
kind=definition name=unit_price
kind=definition name=subtotal
kind=definition name=tax
kind=definition name=total
kind=section name=Calculations
| field | what it is |
|---|---|
edges | List of {from, to, reads}: from reads to, at each place in reads |
nodes | List of {id, kind, name, source, external}: each definition and section, and each name it reads from another note (external) |
schemaVersion | Number: the version of the format, which changes when a field does |