Every block, part and run of the document format, with its fields
Generated from the format's registry, so it always matches what validators accept.
Every block, part and run of the format, from the registry. The rules for all of them are in document.md.
Context | Allows | |
|---|---|---|
document |
| The document's top level. |
tab |
| A tab: everything but tabs. |
layout |
| A column, a step, an accordion: no layout inside layout. |
flow |
| A quote, a callout, a list item: no tables, cards or layout. |
cell |
| A table cell: simple content. |
Groups: text (paragraph, heading, code): Blocks of text: paragraphs, headings, code. media (image, video, file, embed, divider, fileTree, drawing, diagram): Blocks that show one thing: images, videos, files, embeds, dividers, file trees, drawings, diagrams. flow (quote, callout, list): Containers of running content: quotes, callouts, lists. structure (table, cards): Tables and cards. layout (tabs, columns, steps, accordion): Blocks that lay content out: tabs, columns, steps, accordions.
Every block has an id (required, unique in the document) and its type.
A paragraph. Group: text.
Field | Kind | Default | |
|---|---|---|---|
|
|
| Text alignment. |
| text | none | The paragraph's text. |
A section heading. Group: text.
Field | Kind | Default | |
|---|---|---|---|
|
|
| 1 to 3. |
|
|
| Text alignment. |
| text | none | The heading's text. |
Preformatted code. Group: text.
Field | Kind | Default | |
|---|---|---|---|
| string |
| The language it's written in, a lowercase name (typescript, go, bash, mermaid…); empty for none. |
| string |
| Shown as a title above the code; empty for none. |
| string |
| The code: plain text, lines separated by \n. |
A quotation. Group: flow.
Field | Kind | Default | |
|---|---|---|---|
| blocks (flow) | required | The quotation. |
A highlighted box. Group: flow.
Field | Kind | Default | |
|---|---|---|---|
|
|
| How it looks: a note, a tip, a warning, a danger. |
| blocks (flow) | required | What it says. |
A bulleted, numbered or task list. Group: flow.
Field | Kind | Default | |
|---|---|---|---|
|
|
| Bullets, numbers or checkboxes. |
| integer ≥ 0 |
| Ordered lists: the first item's number. |
| boolean |
| Task lists: checked items move to the end. |
| listItem[], at least 1 | required | The items. |
A table. Group: structure.
Field | Kind | Default | |
|---|---|---|---|
|
| Column widths, set when someone resizes a column; empty for automatic layout. | |
| tableRow[], at least 1 | required | The rows. |
A grid of cards. Group: structure.
Field | Kind | Default | |
|---|---|---|---|
| card[], at least 1 | required | The cards. |
Tabs, one of which shows at a time. Only at the top level of a document. Group: layout.
Field | Kind | Default | |
|---|---|---|---|
| string |
| Tab groups with the same name switch together: picking a tab in one picks the tab with the same label in the others. |
| tab[], at least 1 | required | The tabs. |
Side-by-side columns. Group: layout.
Field | Kind | Default | |
|---|---|---|---|
| column[], at least 1 | required | The columns, of equal width. |
Numbered steps. Group: layout.
Field | Kind | Default | |
|---|---|---|---|
| step[], at least 1 | required | The steps, numbered in order. |
A section that opens and closes. Group: layout.
Field | Kind | Default | |
|---|---|---|---|
| text | none | What shows when it's closed. |
| blocks (layout) | required | What shows when it's open. |
An image. Group: media.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The image's address: an uploaded file (/files/…) or any URL. |
| string |
| Alternative text. |
A video file, played in place. Group: media.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The video file's address. |
| string |
| The file name. |
A file to download. Group: media.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The file's address. |
| string |
| The file name. |
| integer ≥ 0 |
| Size in bytes; 0 when unknown. |
Embedded content from another site. Group: media.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The page to embed. Renderers with a web view show it; others show a link card, and play YouTube and Vimeo links where they can. |
A dividing line. Group: media.
No fields but id and type.
A file and folder tree. Group: media.
Field | Kind | Default | |
|---|---|---|---|
|
| The top-level files and folders. |
A drawing: shapes, arrows, freehand strokes, text and images. Group: media.
Field | Kind | Default | |
|---|---|---|---|
| scene | none | The drawing (spec/drawing.md). |
A diagram made from text, laid out by the diagram engine. Group: media.
Field | Kind | Default | |
|---|---|---|---|
|
|
| The kind of diagram (spec/diagram-language.md). |
| string |
| The diagram text: the source of truth. |
| none | What the user changed by hand: positions of moved boxes, and the text the scene was last laid out from. | |
| scene | none | The drawing: the elements laid out from the text (they have keys) and any drawn next to them by hand (they don't). |
Parts are the pieces of a block (a list's items, a table's rows). They have no type: the field they're in says what they are.
A list item.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| boolean |
| Task lists: whether it's done. |
| blocks (flow; first a paragraph or heading) | required | The item's content: a paragraph or heading first, then any blocks (nested lists among them). |
A table column's width.
Field | Kind | Default | |
|---|---|---|---|
| number ≥ 0 | required | The column's width as a fraction of the table's; the widths add up to 1. |
A table row.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| tableCell[], at least 1 | required | The cells. |
A table cell.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| boolean |
| A header cell. |
| integer ≥ 1 |
| Columns it spans. |
| integer ≥ 1 |
| Rows it spans. |
| blocks (cell) | required | The cell's content. |
A card.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| string |
| The card's title. |
| string |
| The card's text. |
| string |
| A cover image's address; empty for none. |
| string |
| Where it links to; empty for nowhere. A note takes precedence. |
| string |
| The note it links to; empty for none. |
| string |
| That note's name when linked, for readers that can't look it up. |
A tab.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| string |
| The tab's label. |
| blocks (tab) | required | The tab's content. |
A column.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| blocks (layout) | required | The column's content. |
A step.
Field | Kind | Default | |
|---|---|---|---|
| string | required | Unique in the document. |
| text | none | The step's title. |
| blocks (layout) | required | The step's content. |
A file or folder in a file tree.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The file or folder name. |
| boolean |
| A folder. |
| boolean |
| Highlighted (the file the text is about). |
|
| What's inside it. |
A diagram's layout state.
Field | Kind | Default | |
|---|---|---|---|
| { key: box } |
| Where boxes the user moved are, by element key (n:<name>): x, y, and w and h when the user sized them. |
| string |
| The text the scene was last laid out from, to recognise renames when the text changed elsewhere. |
Text is a list of runs. Which kind a run is follows from its fields: text, note or break.
Text with the same formatting.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The text; never empty. |
| boolean |
| Bold. |
| boolean |
| Italic. |
| boolean |
| Underlined. |
| boolean |
| Struck through. |
| boolean |
| Inline code. |
| link | none | A hyperlink: href (a URL, a #heading anchor or a relative path) and an optional title. |
A link to another note, shown with the note's current name. Counts as one position.
Field | Kind | Default | |
|---|---|---|---|
| string | required | The note linked to. |
| string |
| That note's name when linked, for readers that can't look it up. |
A line break. Counts as one position.
Field | Kind | Default | |
|---|---|---|---|
| boolean | required | Always true. |