xmd

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

fieldwhat it is
anchorthe LSP position at the end of its line, where your editor draws its result
errorsList of Text: what went wrong with it, empty when nothing did
kindText: what the record is, the collection's name in the singular: task, value, section
lineNumber: the zero-based line it is on
sourceRecord: where it is: path, uri, line (one-based) and range
titleText: 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
fieldwhat it is
computedBoolean: whether it is calculated, rather than written as a value
displayText: its value as the note shows it inline, $1,324
end_lineNumber: one past its last line, the lines it holds included
expressionText: the expression as written
formText or Null: the form its definition calls, maximize, minimize or solve
gridList of {line, cells, text}: the table under it, each line as written, header and divider included
headerNumber or Null: the line of that table's header
hoverText: the Markdown your editor shows when you hover it
nameText or Null: the name it was given, budget in $3,000:budget
problemsList: what is wrong with that table, like a missing cell or a bad name
recordRecord or Null: everything a form worked out, for a definition that calls one
typeText: the kind of its value: Money, Date, Table, Plan
valuewhat 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
fieldwhat it is
bracketedBoolean: whether it is written in square brackets in a sentence, [total]
displayText: its value as the note shows it inline, $1,324
expressionText: the expression as written
typeText: the kind of its value: Money, Date, Table, Plan
valuewhat 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
fieldwhat it is
displayText: its value as the note shows it inline, $1,324
expressionText: the expression as written
hoverText: the expression as written, which your editor's hover starts from
nameText: the name it reads
propertyText or Null: the field it reads, remaining in focus.remaining
typeText: the kind of its value: Money, Date, Table, Plan
valuewhat 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
fieldwhat it is
bracketBoolean: whether it is in square brackets in a sentence
hoverText: the Markdown your editor shows when you hover it
nameText: the name
propertyText 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
fieldwhat it is
computedBoolean: whether it is calculated, rather than written as a value
displayText: its value as the note shows it inline, $1,324
end_lineNumber: one past its last line, the lines it holds included
expressionText: the expression as written
formText or Null: the form its definition calls, maximize, minimize or solve
gridList of {line, cells, text}: the table under it, each line as written, header and divider included
headerNumber or Null: the line of that table's header
hoverText: the Markdown your editor shows when you hover it
nameText or Null: the name it was given, budget in $3,000:budget
problemsList: what is wrong with that table, like a missing cell or a bad name
recordRecord or Null: everything a form worked out, for a definition that calls one
typeText: the kind of its value: Money, Date, Table, Plan
valueList 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
fieldwhat it is
cellsRecord: the row's cells by column name, each evaluated
tableText: 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
fieldwhat it is
columnText: its column's header
computedBoolean: whether it is a calculation in brackets, [unit_price * 3]
displayText: its value as the note shows it inline, $1,324
expressionText: the expression as written
rowNumber: its row, from 0
tableText: the name of its table
typeText: the kind of its value: Money, Date, Table, Plan
valuewhat 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
fieldwhat it is
computedBoolean: whether it is calculated, rather than written as a value
displayText: its value as the note shows it inline, $1,324
end_lineNumber: one past its last line, the lines it holds included
expressionText: the expression as written
gridList of {line, cells, text}: the table under it, each line as written, header and divider included
headerNumber or Null: the line of that table's header
hoverText: the Markdown your editor shows when you hover it
nameText or Null: the name it was given, budget in $3,000:budget
problemsList: what is wrong with that table, like a missing cell or a bad name
solutionRecord: the solved plan: each unknown, the objective, and each constraint and whether it binds
typeText: the kind of its value: Money, Date, Table, Plan
valueRecord: 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
fieldwhat it is
computedBoolean: whether it is calculated, rather than written as a value
displayText: its value as the note shows it inline, $1,324
end_lineNumber: one past its last line, the lines it holds included
expressionText: the expression as written
formText or Null: the form its definition calls, maximize, minimize or solve
gridList of {line, cells, text}: the table under it, each line as written, header and divider included
headerNumber or Null: the line of that table's header
hoverText: the Markdown your editor shows when you hover it
nameText or Null: the name it was given, budget in $3,000:budget
problemsList: what is wrong with that table, like a missing cell or a bad name
recordRecord or Null: everything a form worked out, for a definition that calls one
typeText: the kind of its value: Money, Date, Table, Plan
valuewhat 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
fieldwhat it is
planText: the name of the plan that decides it
titleText: the name of the plan that decides it
valueBoolean 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
fieldwhat it is
atDate or DateTime: when it happens, from @at or an itinerary's time, or null
at_dateDate: the day of at, or null
attributesRecord: each attribute it writes, as written, by key: {due: "2026-10-15"}
blocked_byList of Text: what its @after still waits on, as written
blocked_errorText or Null: why its @after could not be read
blockersList of {name, source}: the named items its @after still waits on
checkedBoolean: whether its own box is ticked, [x]. done also counts its subtasks
childrenList of {line, done}: its subtasks
doneBoolean: whether it is complete; an item with subitems is complete when every one is
dueDate or DateTime: from @due; a task with @every and no @due is due today
estimateDuration: from @estimate, or null
hoverText: the Markdown your editor shows when you hover it
in_progressBoolean: started but not done: marked [-], or some of its subtasks done
leafBoolean: whether it has no subtasks of its own. Only leaves join entries
nameText or Null: the name it was given, budget in $3,000:budget
parentRecord or Null: the item it nests under, as path, uri, line and range
scheduleList of {key, value, error}: its @due, @scheduled and @at, in the order written
scheduledDate or DateTime: from @scheduled, or null
tagsList of Text: its #tags and @tags
timerTimer 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
fieldwhat it is
attributesRecord: each attribute it writes, as written, by key: {due: "2026-10-15"}
checkboxthe LSP range of its [ ]
childrenList of Number: the lines of the items nested under it
doneBoolean: checked, or every subitem done when it has some
hoverText: the Markdown your editor shows when you hover it
indentNumber: its indentation in bytes
markopen, in_progress or done: what its checkbox says
nameText or Null: its trailing :name
name_rangethe LSP range of its name, or null
parentNumber or Null: the line of the item it nests under, the nearest one indented less, until a heading
rangethe LSP range of the line's text, the blanks around it aside
titleText: 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
fieldwhat it is
attributesRecord: 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
blockitem, prose or row
rangethe LSP range of the line's text, the blanks around it aside
taskBoolean: whether the line is a task
titleText: 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
fieldwhat it is
atDate or DateTime: when it happens, from @at or an itinerary's time, or null
at_dateDate: the day of at, or null
attributesRecord: each attribute it writes, as written, by key: {due: "2026-10-15"}
blocked_byList of Text: what its @after still waits on, as written
blocked_errorText or Null: why its @after could not be read
blockersList of {name, source}: the named items its @after still waits on
checkedBoolean: whether its own box is ticked, [x]. done also counts its subtasks
childrenList of {line, done}: its subtasks
doneBoolean: whether it is complete; an item with subitems is complete when every one is
dueDate or DateTime: from @due; a task with @every and no @due is due today
estimateDuration: from @estimate, or null
hoverText: the Markdown your editor shows when you hover it
in_progressBoolean: started but not done: marked [-], or some of its subtasks done
leafBoolean: whether it has no subtasks of its own. Only leaves join entries
nameText or Null: the name it was given, budget in $3,000:budget
parentRecord or Null: the item it nests under, as path, uri, line and range
scheduleList of {key, value, error}: its @due, @scheduled and @at, in the order written
scheduledDate or DateTime: from @scheduled, or null
tagsList of Text: its #tags and @tags
timerTimer 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
fieldwhat it is
atDate or DateTime: when it happens, from @at or an itinerary's time, or null
at_dateDate: the day of at, or null
blocked_byList of Text: what its @after still waits on, as written
doneBoolean: whether it is complete; an item with subitems is complete when every one is
dueDate or DateTime: from @due; a task with @every and no @due is due today
estimateDuration: from @estimate, or null
leafBoolean: whether it has no subtasks of its own. Only leaves join entries
parentRecord or Null: the item it nests under, as path, uri, line and range
scheduledDate or DateTime: from @scheduled, or null
tagsList 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
fieldwhat it is
atDate or DateTime: when it happens, from @at or an itinerary's time, or null
at_dateDate: the day of at, or null
blocked_byList of Text: what its @after still waits on, as written
doneBoolean: whether it is complete; an item with subitems is complete when every one is
dueDate or DateTime: from @due; a task with @every and no @due is due today
estimateDuration: from @estimate, or null
leafBoolean: whether it has no subtasks of its own. Only leaves join entries
parentRecord or Null: the item it nests under, as path, uri, line and range
scheduledDate or DateTime: from @scheduled, or null
tagsList 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
fieldwhat it is
valueRecord: 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
fieldwhat it is
definitionBoolean: whether this is where the timer is defined, rather than read
hoverText: the Markdown your editor shows when you hover it
inlayBoolean: whether your editor draws the timer's state here
nameText: the timer's name
originRecord: the document and name of the definition it belongs to
valueRecord: its state: state (idle, running or paused), running, elapsed, duration, remaining for a countdown, and when it started

Links in notes, and what is known about what they point at.

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
fieldwhat it is
urlText: 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
fieldwhat it is
metadataRecord or Null: what a refresh last fetched about it, like a pull request's state; null before one
targetText: 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
fieldwhat it is
textText: the whole note as written
titleText: 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
fieldwhat it is
end_lineNumber: one past its last line, the lines it holds included
levelNumber: 1 for #, 2 for ##, and so on
titleText: 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
fieldwhat it is
anchorthe LSP position just past the match, where an inlay goes
end_lineNumber: one past its last line, the lines it holds included
groupsRecord: each named group that took part, as {text, range}, with term (Text or Null) when the recognizer declares terms for it
moduleText: the id of the module that declared it
parentNumber or Null: the line of the match it is under
rangethe match's LSP range
recognizerText: the recognizer's name
textText: the matched text
titleText: 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
fieldwhat it is
codeText: what kind of problem it is, like name, property or module
messageText: what is wrong
severityerror, 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
fieldwhat it is
bracketedBoolean: whether it is written in square brackets in a sentence, [total]
checkedBoolean: whether a checkbox is ticked
childrenList of Text: the ids of the nodes in it
columnNumber: a cell's column, from 0
computedBoolean: whether it is calculated, rather than written as a value
domainText: a decision column's domain, Choice or Count
formText or Null: the form its definition calls, maximize, minimize or solve
groupsRecord: a recognized match's named groups, as text
hoverText: the Markdown your editor shows when you hover it
idText: the node's id, unique in the workspace
indexNumber: a row's or a column's position, from 0
kindText: the node's kind: document, section, line, definition, binary, call, literal and more
levelNumber: a section's heading level
moduleText: the module whose recognizer matched
nameText: the name it defines or reads
operatorText: a binary or unary operator
parametersList of Text: a function's parameters
parentText or Null: the id of the node it is in
propertyText or Null: the field it reads, remaining in focus.remaining
roleText: what it is to its parent: expression, left, right, argument and more
schemaVersionNumber: the version of the format, which changes when a field does
stateText: a checkbox's mark: open, in_progress or done
targetText: a link's target
textText: the source it covers
titleText: a section's heading, or a task's or line's text
typeText: a column's type
valuea 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
fieldwhat it is
edgesList of {from, to, reads}: from reads to, at each place in reads
nodesList of {id, kind, name, source, external}: each definition and section, and each name it reads from another note (external)
schemaVersionNumber: the version of the format, which changes when a field does