Body & detail
The { } and [ ] slots: which constructs take each, what a slot accepts, what a scene keeps to each side, and inline content in attributes.
On this page
#The { } body and the [ ] detail
A construct holds content in two bracketed slots after its head: the { } body and the [ ] detail, written in that order. Most constructs take a body or nothing. Four also take a detail, and in each the detail is the second half of the construct:
scene— the body is the narrative, the detail the canvas.task— the body sets the exercise, the detail holds a hint or solution, collapsed until revealed.question— the body is the prompt, the detail the feedback shown when the question closes.option— the body is the answer offered, the detail the feedback shown when it was picked.
scene{
The narrative.
}[
graph{
curve(expression: x^2)
}
]#What a slot accepts
Each slot accepts one of four kinds of content, and every reference page states which under Allowed content:
- Constructs, from a list. Anything else written there is an error. A
graphbody takes marks, cues and controls, and no prose. - Inline text: prose with micronodes, such as a
box's label or a!link's words. - Literal text, kept as written: the code in
lines, the TeX inequation. Micronodes, delimiters and//comments are not read there. - Nothing. Marks take no body; a mark's words are its
label:attribute.
A sentence written in a graph body is refused: node `paragraph` is not allowed in `graph` when `plane: xy`.
The same list read the other way round is printed on every node's page under Allowed in: the constructs whose slots accept it.
#A scene's body and detail
A scene's two slots share some constructs and keep others to one side:
- Either slot: paragraphs, the four headings,
listandequation. - The body only: the callouts
definition,example,note,panel,task,theoremandwarning, theinternotereference,dividerandstep. - The detail only: the environments
graph,code,region,flowchart,logicandnetwork, and thegridthat lays them out;table,imageandquestion; the controlssliderandselector; and the cues.
Four micronodes are refused in the body, wherever in it they are written: the text colours, !highlight with its ==…== spelling, !symbol and !cue.highlight. Bold, italic, code and maths are read in both slots. The colour goes on the canvas, in the detail:
scene{
The teal curve is the faster decay.
}[
The !teal{teal} curve is the faster decay.
graph{
curve(f: e^(-2x); colour: teal)
curve(f: e^(-x))
}
]Written in the body, it is refused:
scene{
The !teal{teal} curve is the faster decay.
}[semantic]'!teal' is not allowed in the narrative; colour, highlighting and symbols belong in the canvas
#Inline content in an attribute
An attribute of type rich-text takes inline text, read as a paragraph's is: formatting, $maths$, micronodes and {{…}} expressions. Every mark's label: is rich text, as are a graph's axis labels, a control's name:, a callout's title:, a definition's term: and an image's caption:. The type column of each reference page says which attributes are.


graph{
curve#h(expression: 20x - 5x^2; label: $h = 20t - 5t^2$)
point(x: 2; y: 20; label: !teal{highest point})
text(x: 2; y: 8; label: peak **{{round(#h.max, 1)}} m**)
}(
x domain: [0, 4]
y domain: [0, 25]
x axis label: $t$ (s)
y axis label: $h$ (m)
)A rich-text value holds inline content only. Where a canvas needs a paragraph, a list or an equation, the scene's detail takes one directly.