Node use & the bare reference
Every structure in Wit is a node — a name that wraps content. This page is the atom the rest of the language builds on: how a node opens and closes, where its name ends, and how the same handle reaches into data. Read it before parameters, before definitions.
Opening, closing, and the body
An opening handle is @name; the matching close is name@; the body is everything between them.
@aside A note set apart from the main text. aside@
Scope comes from the open/close pair, never from indentation — you may indent for your eye, but the parser only counts handles. Nodes nest, and two uses of the same name pair last-in-first-out, like brackets:
@quote @cite Weil cite@ wrote of attention. quote@
The inner @cite … cite@ closes before the outer @quote … quote@.
Block or inline is decided by position
Whether a node renders as a block or inline is a renderer decision from position, never something you mark. A node that stands alone on its own line becomes a block; a node sitting inside a run of prose stays inline.
@aside This is a block — it sits on its own line. aside@ The lamp was @highlight still burning highlight@ at dawn.
The first is a block aside; the second keeps @highlight … highlight@ inline in the sentence.
The bare reference
A handle with no body and no closer is a bare reference — a pointer to a defined entity, resolved when the document expands. It is how you cite named content mid-sentence.
Attention, as @weil argued, is a moral act.Here @weil stands in for whatever #weil defines
.
Where the handle ends
The handle name is the character class [A-Za-z0-9_-] — letters,
digits, underscore, and hyphen. The first byte that is not in that
class ends the handle. A leading dot instead opens a data-access path
(see below); anything else — a space, comma, or period — closes the name.
@paper-stats ~ hyphen is part of the name @chapter_one ~ underscore is part of the name @h2 ~ a trailing digit is fine @weil, the writer ~ the comma ends the handle
These are fixtures 04-nodes-use/hyphenated-name, underscored-name, numeric-suffix, and bare-reference. A following space or comma simply ends the name and returns to prose (bare-reference-adjacent-prose).
Access paths in prose
Wherever a bare reference is legal, so is a data-access path: @name.field reaches into a record or collection and drops the
value straight into your sentence.
The title is @book.title for this edition.The chain follows dots until it hits a byte that is not part of a segment — the
sentence-final period ends it cleanly. This
is the verified way to put data into prose; {{book.title}} does not interpolate in a paragraph.
Empty bodies and nesting
An empty pair @x x@ is a real node with an empty
children array — not null, and the single space between the markers is
not counted as a child. Nesting has no depth
limit; the pairing is purely lexical.
Common mistakes
- Expecting a period to stay in the name.
@weil.ends the handle at the period; the sentence keeps its full stop. Only a dot followed by an identifier opens an access path. - Assuming the name is case-insensitive.
@Weiland@weilare different handles. - Writing an email address in prose. A word immediately
followed by
@— as inkeeper@host— reads as a close token and splits your paragraph. To show one literally, wrap it in frozen code. See the Gotchas guide.
See also
Parameters: choosing a form· Defining nodes · Data access · Gotchas & ambiguity · Core vocabulary