Ord - Outline and Relational Data

A simple and powerful markup language for note-taking and structured information.

Ord specification

Version 0.7.0-draft, 2026-11-22.

Introduction

Ord is a plain-text outline format. Each line is a node or a field, indentation makes the tree, and fields make the outline structured data. This spec says how text is read into a tree, how a tree is written back as text, and how the shortform for system fields is read out of labels.

The spec has three parts:

Companion documents build on it:

Design goals

These goals are informative. They explain the rules and decide new ones.

Conventions

Conformance


Part 1: Core Ord

1. Data model

Reading turns a file into this model, and writing turns the model back into text. The rest of Part 1 says how.

Node      label     Text, empty, or absent (anonymous node)
          children  ordered list of Field and Node

Field     key       text
          items     ordered list of Item
          list      true or false (C16)

Item      Text or Node

Text      value     the text, with any quotes removed (C21)
          quoted    true or false

A label or item records whether it was quoted, since Part 2 reads only unquoted text (L1) and writers treat its trailing whitespace differently (C34).

Every model read from text follows C38 to C40. A writer may reject a model that breaks them, since no text expresses it.

2. File

⟨U+FEFF⟩a:: b⟨U+000D⟩
⟨U+3000⟩c
d⟨U+3000⟩:: e
f:: lone⟨U+000D⟩cr
.
root
  field "a"
    "b"
  node "\u3000c"
  field "d\u3000"
    "e"
  field "f"
    "lone\rcr"
! C3.1 2:1
! C3.2 3:2

A no-break space is read as a space: in the indent, around :: and ;, and in text.

Tasks
⟨U+00A0⟩⟨U+00A0⟩Call⟨U+00A0⟩Anna
a⟨U+00A0⟩::⟨U+00A0⟩x⟨U+00A0⟩;⟨U+00A0⟩y
.
root
  node "Tasks"
    node "Call Anna"
  field "a"
    "x"
    "y"
Open slot #hej⟨U+00A0⟩+hej⟨U+00A0⟩^hej
.
root
  node "Open slot #hej +hej ^hej"
    label "Open slot #hej"
    field "_tags" embedded
      "hej"
    field "_types" inline
      "hej"
    field "_id" inline
      "hej"

3. Reading order

So a quote and a bracket can hide :: and ; (both come before the separator), but neither hides a block's delimiters (blocks come first).

4. Blocks

Notes
→```js
→␣␣a:: b
→
→```
"x
````md
```
it's raw \n
```
````
'''
.
root
  node "Notes"
    node "```js\n  a:: b\n\n```"
  node "\"x"
  node "````md\n```\nit's raw \\n\n```\n````"
  node "'''"
Inv
→total:: =(
→→$sum(x)
→); 4
→sub::
→→=(1 +
→→␣␣2)
→note:: sad =(
→Total =(
→→1)
→=(2 *
→→3)
→→kid
.
root
  node "Inv"
    field "total"
      "=(\n\t$sum(x)\n)"
      "4"
    field "sub"
      node "=(1 +\n  2)"
    field "note"
      "sad =("
    node "Total =("
      node "1)"
    node "=(2 *\n\t3)"
      node "kid"

5. Quoting and spans

Send draft [due:: 2026-10-10]
See [[a::b]] now
a [b [c:: d] e:: f] g:: h
a [b:: c
[x] Call:: Anna
links:: [[a; b]]; c
note:: Call [due:: x; y]
d:: a [b; c
.
root
  node "Send draft [due:: 2026-10-10]"
  node "See [[a::b]] now"
  field "a [b [c:: d] e:: f] g"
    "h"
  field "a [b"
    "c"
  field "[x] Call"
    "Anna"
  field "links"
    "[[a; b]]"
    "c"
  field "note"
    "Call [due:: x; y]"
  field "d"
    "a [b"
    "c"
a:: ""
b:: " hello"
c:: "x; y"
d:: "line 1\nline 2"
e:: "\"Hi\""
f:: 'x; y'
g:: `C:\temp`
h:: say "hi" now
.
root
  field "a"
    quoted ""
  field "b"
    quoted " hello"
  field "c"
    quoted "x; y"
  field "d"
    quoted "line 1\nline 2"
  field "e"
    quoted "\"Hi\""
  field "f"
    "'x"
    "y'"
  field "g"
    "`C:\\temp`"
  field "h"
    "say \"hi\" now"
a:: "x"␣␣
b:: "\q"
c:: x "a;b" y; z
d:: "a:: b; c"
e:: x `a;b` y; z
.
root
  field "a"
    quoted "x"
  field "b"
    quoted "\\q"
  field "c"
    "x \"a"
    "b\" y"
    "z"
  field "d"
    quoted "a:: b; c"
  field "e"
    "x `a;b` y"
    "z"
! C22 2:6

6. Line

a :: b
a:: b::c
a::b
Send draft due::2026-10-10
a::;
hello
:: hello
a::␣␣␣
.
root
  field "a"
    "b"
  field "a"
    "b::c"
  field "a"
    "b"
  field "Send draft due"
    "2026-10-10"
  field "a" list
  node "hello"
  node "hello"
  field "a"
The quick brown fox jumps over the lazy dog and keeps on running:: x
Note:: the key's length doesn't matter
.
root
  field "The quick brown fox jumps over the lazy dog and keeps on running"
    "x"
  field "Note"
    "the key's length doesn't matter"
"a::b":: c
"a::b"
`a:: b` is a field
Anna's key:: Erik's value
.
root
  field "a::b"
    "c"
  node quoted "a::b"
  node "`a:: b` is a field"
  field "Anna's key"
    "Erik's value"

7. Tree

Project
→Task one
→→due:: 2026-10-20
␣␣
→Task two
␣␣Mixed indent child
Second root
.
root
  node "Project"
    node "Task one"
      field "due"
        "2026-10-20"
    node "Task two"
      node "Mixed indent child"
  node "Second root"

8. Fields and nodes

"":: x
Note; with semicolon
k:: x
→Anna
→primary:: anna
→Erik
m:: a;;
;
→a
→b:: c
.
root
  field ""
    "x"
  node "Note; with semicolon"
  field "k"
    "x"
    node "Anna"
    node "Erik"
    node
      field "primary"
        "anna"
  field "m" list
    "a"
  node ";"
    node "a"
    field "b"
      "c"

9. Items in a field's value

a::
b:: anna
c:: anna;
d:: anna; oscar
e:: a;;b
f::;
g:: ;;a
h:: a\;b; c
i:: `a;b`; c
.
root
  field "a"
  field "b"
    "anna"
  field "c" list
    "anna"
  field "d"
    "anna"
    "oscar"
  field "e"
    "a"
    "b"
  field "f" list
  field "g" list
    "a"
  field "h"
    "a\\"
    "b"
    "c"
  field "i"
    "`a;b`"
    "c"
a:: =$f(a; b); c
b:: =($a & ')'; $b)
c:: x(a; b)
d:: =f(a; b
e:: =(a\;b)
f:: =($a & "x; y"); z
.
root
  field "a"
    "=$f(a; b)"
    "c"
  field "b"
    "=($a & ')'; $b)"
  field "c"
    "x(a"
    "b)"
  field "d"
    "=f(a"
    "b"
  field "e"
    "=(a\\;b)"
  field "f"
    "=($a & \"x; y\")"
    "z"

10. Writing

a  ::   x ;y;;  z
b::;
c :: "plain"
Send→draft→+task␣␣
␣␣
f::
  g:: "tab→here"
  h:: "nb\u00A0sp"
.
a:: x; y; z
b:: ;
c:: "plain"
Send→draft→+task

f::
→g:: "tab\there"
→h:: "nb\u00a0sp"
Notes
␣␣```
␣␣x
␣␣␣␣y
␣␣```
.
Notes
→```
→x
→␣␣y
→```
k:: x;
"a:b:":: v
Key:: ends with \
::
"Label: with:: sep"
'single'
a:: say `hi`; "x
b:: x [y; z
c:: [[a; b]]; d
`code`
.
k:: x;
"a:b:":: v
Key:: ends with \
::
"Label: with:: sep"
'single'
a:: "say `hi`"; "\"x"
b:: "x [y"; z
c:: [[a; b]]; d
`code`
⟨U+FEFF⟩a :: b⟨U+000D⟩
c::  d
.
⟨U+FEFF⟩a:: b⟨U+000D⟩
c:: d⟨U+000D⟩

10a. Writing conventions (non-normative)

These are recommendations for writers and editors. A file that doesn't follow them is still valid.

11. Diagnostics

Code Severity Given when Position
C3.1 warning A whitespace character other than space or tab starts a line's text, after the indent that character
C3.2 warning A whitespace character other than space or tab is next to a :: outside spans, or separated from it only by spaces and tabs that character
C22 warning A backslash in " quotes is not followed by an escape character the backslash
C29 warning A block has no closing line and runs to the end of the file the opening line's first character after the indent
C49 warning A line holds bytes that aren't valid UTF-8, once per line the first character read from them

Part 2: Label syntax

A field can be written in three ways: as a field line (key:: value, Part 1), as an inline field in a label ([key:: value]), or as a trigger, a shortform for an inline field. Part 2 reads inline fields and triggers out of labels and items, and value forms, such as numbers and dates, out of items. It doesn't change Core: labels and items stay strings there, and Part 2 can be applied to them at any time. What the fields mean (single-valued fields, merging, types, references) is in Semantics.

12. Scope

+task Send draft [due:: 2026-10-20] #urgent [x] ^s1
- [x] Done +b #a
Plan [_types:: task] [_tags:: x]
Ship [_state:: done]
.
Send draft #urgent [x] [due:: 2026-10-20] +task ^s1
- [x] Done #a +b
Plan [_tags:: x] +task
[x] Ship

13. Inline fields

Meet [due date:: 2026-10-21] [_types:: task] [Project lead:: anna]
Not fields: [two  spaces:: x] and [1 day:: y]
.
root
  node "Meet [due date:: 2026-10-21] [_types:: task] [Project lead:: anna]"
    label "Meet"
    field "due date" inline
      "2026-10-21" date
    field "_types" inline
      "task"
    field "Project lead" inline
      "anna"
  node "Not fields: [two  spaces:: x] and [1 day:: y]"
Plan [#Ord notes] now +task
Also [#a; b c]
[#x](https://example.com) and [#1]
.
root
  node "Plan [#Ord notes] now +task"
    label "Plan now"
    field "_tags" inline
      "Ord notes"
    field "_types" inline
      "task"
  node "Also [#a; b c]"
    label "Also"
    field "_tags" inline
      "a"
      "b c"
  node "[#x](https://example.com) and [#1]"
    field "_url" embedded
      "https://example.com"
? [ ] +task @anna
- ? #urgent
?x and ? alone
\? not a search
.
root
  node "? [ ] +task @anna"
    label ""
    field "_types" inline
      "search"
    field "query" inline
      "[ ] +task @anna"
  node "- ? #urgent"
    label ""
    field "_types" inline
      "search"
    field "query" inline
      "#urgent"
  node "?x and ? alone"
  node "\\? not a search"
    label "? not a search"
@ Send mapping draft^t9x1
- @Apollo +project
@→
[x] @ not a mirror
\@ Erik
.
root
  node "@ Send mapping draft^t9x1"
    label ""
    field "_mirror" inline
      "Send mapping draft^t9x1"
  node "- @Apollo +project"
    label ""
    field "_mirror" inline
      "Apollo +project"
  node "@\t"
    label "@"
  node "[x] @ not a mirror"
    label "@ not a mirror"
    field "_state" inline
      "done"
  node "\\@ Erik"
    label "@ Erik"
attendees:: @Anna Smith; @ Erik; "@quoted"
see:: [[Anna]] and @Erik
- Meet [with:: @Anna]
.
root
  field "attendees"
    "@Anna Smith" _mirror
    "@ Erik" _mirror
    quoted "@quoted"
  field "see"
    "[[Anna]] and @Erik"
      field "_link" embedded
        "[[Anna]]"
  node "- Meet [with:: @Anna]"
    label "Meet"
    field "with" inline
      "@Anna" _mirror
@Apollo
- @→Erik Berg
meeting:: @ Anna Smith; @Erik
.
@ Apollo
- @ Erik Berg
meeting:: @Anna Smith; @Erik

14. Triggers

Field Trigger Read as Value
_types +task [_types:: task] a type name
_id ^t9x1 [_id:: t9x1] an ID
_link [[Node label]], [[anna-47xu]], [[Node label^anna-47xu]] [_link:: [[Node label]]], [_link:: [[anna-47xu]]] a node's label or ID, or both
_state [ ], [x] [_state:: new], [_state:: done] a state name
_result =sum(x), =(a + b) [_result:: =sum(x)], [_result:: =(a + b)] an expression
_tags #blue, #project/apollo, [#Ord notes] (L29) [_tags:: blue], [_tags:: project/apollo], [_tags:: Ord notes] ordinary text
_url https://example.com, ./spec.pdf [_url:: https://example.com], [_url:: ./spec.pdf] a URL or a path

15. Start of a label

# Heading +task
- # Not a second marker
#tag starts the label
.
root
  node "# Heading +task"
    label "Heading"
    field "_types" inline
      "task"
  node "- # Not a second marker"
    label "# Not a second marker"
  node "#tag starts the label"
    field "_tags" embedded
      "tag"

16. Literal text

16a. Formatting

If _you_ use **Markdown**, you ~~don't~~ ==re-learn== much
.
root
  node "If _you_ use **Markdown**, you ~~don't~~ ==re-learn== much"

17. Label and items

- [-] Buy milk +errand #urgent ^m1lk
+task Call Anna
1. Price +46, C++, C#, #5 and # heading
Two ids ^a1 ^b2
[ ] Call back
[?] Ask Erik
+ [x] Read the spec
.
root
  node "- [-] Buy milk +errand #urgent ^m1lk"
    label "Buy milk #urgent"
    field "_state" inline
      "in-progress"
    field "_types" inline
      "errand"
    field "_tags" embedded
      "urgent"
    field "_id" inline
      "m1lk"
  node "+task Call Anna"
    label "Call Anna"
    field "_types" inline
      "task"
  node "1. Price +46, C++, C#, #5 and # heading"
    label "Price +46, C++, C#, #5 and # heading"
  node "Two ids ^a1 ^b2"
    label "Two ids"
    field "_id" inline
      "a1"
    field "_id" inline
      "b2"
  node "[ ] Call back"
    label "Call back"
    field "_state" inline
      "new"
  node "[?] Ask Erik"
    label "Ask Erik"
    field "_state" inline
      "waiting"
  node "+ [x] Read the spec"
    label "Read the spec"
    field "_state" inline
      "done"
! L8 4:13
Call #anna to decide on budget #projectX. +task
Nested #project/apollo, #a/ and #b-2/c
Not tags: #123 # C# ##x \#y and #
.
root
  node "Call #anna to decide on budget #projectX. +task"
    label "Call #anna to decide on budget #projectX."
    field "_tags" embedded
      "anna"
    field "_tags" embedded
      "projectX"
    field "_types" inline
      "task"
  node "Nested #project/apollo, #a/ and #b-2/c"
    field "_tags" embedded
      "project/apollo"
    field "_tags" embedded
      "a"
    field "_tags" embedded
      "b-2/c"
  node "Not tags: #123 # C# ##x \\#y and #"
    label "Not tags: #123 # C# ##x #y and #"
Plan [due:: 2026-10-20] ["Project lead":: anna] [parts:: a;b] [note:: "two words"] [memo:: two words]
\#literal and \[due:: x] and `#code` here
"Quoted +task label"
#key:: +task #x
who:: [[Anna]]
See https://example.com/a. and ./spec.pdf, not //x
Total =(a + b) then =sum(x
Broken [[link
Sum =$sum(x)*2. Not => or ==
.
root
  node "Plan [due:: 2026-10-20] [\"Project lead\":: anna] [parts:: a;b] [note:: \"two words\"] [memo:: two words]"
    label "Plan"
    field "due" inline
      "2026-10-20" date
    field "Project lead" inline
      "anna"
    field "parts" inline
      "a"
      "b"
    field "note" inline
      quoted "two words"
    field "memo" inline
      "two words"
  node "\\#literal and \\[due:: x] and `#code` here"
    label "#literal and [due:: x] and `#code` here"
  node quoted "Quoted +task label"
  field "#key"
    "+task #x"
  field "who"
    "[[Anna]]" _link
  node "See https://example.com/a. and ./spec.pdf, not //x"
    field "_url" embedded
      "https://example.com/a"
    field "_url" embedded
      "./spec.pdf"
  node "Total =(a + b) then =sum(x"
    field "_result" embedded
      "=(a + b)"
  node "Broken [[link"
  node "Sum =$sum(x)*2. Not => or =="
    field "_result" embedded
      "=$sum(x)*2"
! L12 7:21
! L10 8:8
Call Anna about [[Acme Corp]] +task [client:: [[Acme Corp]]] [due:: 2026-10-20]
See [[anna-47xu]], [[Anna Smith^anna-47xu]] and [[^x1]]
client:: [[Acme Corp]]; see [[Globex]] now
.
root
  node "Call Anna about [[Acme Corp]] +task [client:: [[Acme Corp]]] [due:: 2026-10-20]"
    label "Call Anna about [[Acme Corp]]"
    field "_link" embedded
      "[[Acme Corp]]"
    field "_types" inline
      "task"
    field "client" inline
      "[[Acme Corp]]" _link
    field "due" inline
      "2026-10-20" date
  node "See [[anna-47xu]], [[Anna Smith^anna-47xu]] and [[^x1]]"
    field "_link" embedded
      "[[anna-47xu]]"
    field "_link" embedded
      "[[Anna Smith^anna-47xu]]"
    field "_link" embedded
      "[[^x1]]"
  field "client"
    "[[Acme Corp]]" _link
    "see [[Globex]] now"
      field "_link" embedded
        "[[Globex]]"

18. Value forms

a:: -12; 0; 9.5; 2026; 1e3; 2.5E-7
b:: 007; +46; 1.; .5; 1e
c:: 2026-10-15; 2026-W42; 2026-10
d:: 2026-10-15T14:30; 2026-10-15 14:30:05.5+02:00; 2026-10-15T12:30Z
e:: "2026-10-15"; 2026-02-30
f:: true; false; True; FALSE; yes; "true"
Call Anna [due:: 2026-10-15 14:30]
.
root
  field "a"
    "-12" number
    "0" number
    "9.5" number
    "2026" number
    "1e3" number
    "2.5E-7" number
  field "b"
    "007"
    "+46"
    "1."
    ".5"
    "1e"
  field "c"
    "2026-10-15" date
    "2026-W42" week
    "2026-10" month
  field "d"
    "2026-10-15T14:30" datetime
    "2026-10-15 14:30:05.5+02:00" datetime
    "2026-10-15T12:30Z" datetime
  field "e"
    quoted "2026-10-15"
    "2026-02-30"
  field "f"
    "true" boolean
    "false" boolean
    "True" boolean
    "FALSE" boolean
    "yes"
    quoted "true"
  node "Call Anna [due:: 2026-10-15 14:30]"
    label "Call Anna"
    field "due" inline
      "2026-10-15 14:30" datetime
! L26 5:19

19. Diagnostics

Codes, severities and positions work as in section 11.

Code Severity Given when Position
L8 error A label has more than one _id trigger each _id trigger after the first
L10 warning A [[ has no closing ]] the [[
L11 warning A state marker that no type defines the [
L12 warning A formula has an ( that is never closed the =
L26 warning Text has the digits and separators of a date, datetime, week or month, but a part out of range the text's first character

L11 needs the types' custom markers (Semantics M27). A reader without type definitions takes them as an option.


Part 3: Files

20. Files

These rules are for tools that find files, such as editors, the index and the language server. A reader is given a file and reads it as Ord.

Source: Ord_Specification.md in ordlang/ord, licensed under CC BY 4.0.