Manual
Overview
Language
IntroductionScenes & structureText & inlineGraphsCode panesAnimationDataReuse & logicExpressions & parameters
Elements
Text
ParagraphHeading 1Heading 2Heading 3Heading 4Unordered ListDivider
Media
ImageTableEquation
Callouts
NoteDefinitionExampleTask
Graph
GraphLinePolygonCurveIntegralScatterHistogramPointSegmentVectorCircleSquareRectangleTriangleStarDiamondHexagonTextAxis labelAxis BraceFitResidualsContourHeatmapParameter
Code
Code canvasLines
Animation
CueDraw cueTrace cueHighlight cueSpotlight cueType cue
Structure
SceneStep
Reference
Internote Reference
Inline
Formatting
BoldItalicsInline CodeHighlightLink
Text colour
Red textOrange textYellow textGreen textTeal textBlue textPurple textPink textGrey text
Maths
Maths
Reference
Internote ReferenceValueConstant
Other
FootnoteIcon
Directives
DatasetIncludeConstantsTemplatePresetConditionalForIgnore
Keyframes
KeyframeZoom keyframe
Attribute types
?
  1. Language
  2. Scenes & structure

Scenes & structure

The scene, its narrative and board, steps, and how panes share the canvas.

#The scene

The scene is the unit of the document: a body of narrative and a detail that declares the board. A document is a sequence of scenes, and the reader moves through them in order. The scene's own attributes govern its animation timeline — duration (its implicit attribute, auto by default), autoplay, and loop.

scene{
    # A heading
    Narrative prose, read top to bottom.
}[
    canvas.graph{
        curve(expression: sin(x))
    }
]
Reference:scenestep

#Narrative and board

The body { } holds what is read: paragraphs, headings, lists, equations, callouts, dividers, references. The detail [ ] holds what is shown: canvas panes (canvas.graph, canvas.code) and supporting board content such as table and image. The two halves are choreographed together: as the narrative advances, the board answers.

#Steps

A step — written as === on its own line in the narrative — carves the scene's timeline into steps. Everything animated anchors to those steps: a cue's in: 2 fires at step two, a keyframe's at: 2 starts its move there. Steps are how the prose and the board stay in lockstep: the reader reaching a point in the text is what advances the canvas.

scene{
    First the data alone.
    ===
    Then the fitted line.
}[
    canvas.graph{
        scatter(points: (1, 2.0), (2, 2.4), (3, 3.1))
        cue{
            fit(model: polynomial; degree: 1)
        }(
            in: 1
        )
    }
]

#Panes and splits

A detail may declare two canvas panes; the scene's direction attribute arranges them — horizontal side by side, vertical stacked — and ratio gives the first pane's share over the second's, written as a fraction like 3/2.

scene{
    A graph beside its code.
}[
    canvas.graph#g{
        curve(expression: x^2)
    }
    canvas.code{
        lines{
            y = x ** 2
        }
    }(
        language: python
    )
](
    direction: horizontal
    ratio: 3/2
)

#Continuing a pane

A pane carries an id on its node — canvas.graph#projectile{...} — and a later scene's pane can point back at it with continue: #projectile. What continues is the session state: reader-manipulated parameters, the fit degree they chose, the view they zoomed to. The authored content is the new pane's own — continue: hands off state, never markup.

Ids share one document-wide namespace and resolve forwards and backwards — a continue: may point at a pane declared in any scene, and a collision between any two #ids anywhere is an error.
On this page
The sceneNarrative and boardStepsPanes and splitsContinuing a pane
Scenes & structure · Internote