Reference
.gram syntax
The current source envelope, identifiers, fields, blocks and literal escaping.
Explore as .gram
Text
# .gram syntax
## Current source
A current document begins with `@gram 2`, a `doc <id>` owner, and zero or more typed records. Current writer files end in a Core-owned `@gram-history 6` trailer. The trailer is not authored article content.
`@gram 1` remains a readable legacy source version; it is not the current writer format. IDs are stable document-local identifiers using letters, digits, hyphens or underscores. A record begins with a type code and ID, such as `K local-search` or `T review-index`. IDs are not derived from titles.
## Fields and values
A field is one line: `key value`. The value is the rest of that line and remains text; the format does not coerce a date, number, status or color. Common keys include `t` (title), `d` (description), `x` (status), `s` (scope), `p` (priority), `owner`, `tag`, `source`, `ref`, `view` and `motion`. `t` is required on the document and known records. Singleton fields cannot repeat; `tag` and `source` may repeat.
## Blocks
A literal block starts with `::kind` and ends at a line exactly equal to `::end`. Payload is data, not executable code; block bodies do not nest. Unknown block kinds are retained. When a payload line itself equals `::end`, escape it as `\::end`; the reader removes the escape.
## Minimal valid source
```text
@gram 2
doc index-notes
t Index notes
K lookup
t Keep query boundaries explicit
::reason
The index is a derived view, not canonical document content.
::end
```
See Records for type/field conventions and Relations for edge direction. Source grammar and validation are defined by the linked Core format specification.
Source
.gram language specification
https://github.com/clab-one/thegram-format/blob/main/spec/language.mdCurrent History/6 specification
https://github.com/clab-one/thegram-format/blob/main/spec/source-history-render.mdr0 ·
The current source envelope, identifiers, fields, blocks and literal escaping.
0Needs attention
Source2
.gram language specification
Current History/6 specification
r0 source2034 bytes ·
sha256:002cecd4dbbbcd585106f79a5180c9dd6fff01e1f4db1fe1d2cd335c167b023f@gram 2
doc portal-reference-syntax-guide
t .gram syntax
d The current source envelope, identifiers, fields, blocks and literal escaping.
::body
# .gram syntax
## Current source
A current document begins with `@gram 2`, a `doc <id>` owner, and zero or more typed records. Current writer files end in a Core-owned `@gram-history 6` trailer. The trailer is not authored article content.
`@gram 1` remains a readable legacy source version; it is not the current writer format. IDs are stable document-local identifiers using letters, digits, hyphens or underscores. A record begins with a type code and ID, such as `K local-search` or `T review-index`. IDs are not derived from titles.
## Fields and values
A field is one line: `key value`. The value is the rest of that line and remains text; the format does not coerce a date, number, status or color. Common keys include `t` (title), `d` (description), `x` (status), `s` (scope), `p` (priority), `owner`, `tag`, `source`, `ref`, `view` and `motion`. `t` is required on the document and known records. Singleton fields cannot repeat; `tag` and `source` may repeat.
## Blocks
A literal block starts with `::kind` and ends at a line exactly equal to `::end`. Payload is data, not executable code; block bodies do not nest. Unknown block kinds are retained. When a payload line itself equals `::end`, escape it as `\::end`; the reader removes the escape.
## Minimal valid source
```text
@gram 2
doc index-notes
t Index notes
K lookup
t Keep query boundaries explicit
::reason
The index is a derived view, not canonical document content.
\::end
```
See Records for type/field conventions and Relations for edge direction. Source grammar and validation are defined by the linked Core format specification.
::end
SRC format-language
ref https://github.com/clab-one/thegram-format/blob/main/spec/language.md
t .gram language specification
SRC format-history6
ref https://github.com/clab-one/thegram-format/blob/main/spec/source-history-render.md
t Current History/6 specification