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. Elements
  2. Code
  3. Lines

Lines

linesBlock elementCode

A chunk of literal code lines inside a `canvas.code` pane — the unit cues wrap and the unit everything else addresses. Chunks rather than line numbers, because choreography shifts line numbers: the moment a cue inserts three lines, every number below it points at the wrong line. Common indentation is stripped, so the chalk source can be indented normally.

Attributes

indentImplicit
number
Also written: indent-levelIndentation levels (four spaces each) restored on assembly — the compiler dedents every literal body to its own margin, so a chunk continuing a block states its depth.The head shorthand supplies it: lines:value
Default0
highlight
boolean
The continuous highlight: these lines carry a wash for as long as they are shown. For a momentary one, wrap the chunk in a `cue.highlight`.
Defaultfalse
error-lines
index-list
Also written: error-line, errorsLines to flag with the gutter’s error marker — 1-based within THIS chunk.
error-message
string
Also written: diagnostic, error-noteThe diagnostic the interpreter would give — rendered inline at the end of the chunk's first error line, the way an IDE annotates a broken line.
added-lines
index-list
Also written: added-line, addedDiff wash: these lines carry the green added treatment — 1-based within THIS chunk. Mark what changed instead of narrating it.
removed-lines
index-list
Also written: removed-line, removedDiff wash: these lines carry the red removed treatment — 1-based within THIS chunk.
hidden
boolean
Declared but not assembled.
Defaultfalse
lock
boolean
Also written: lockedReserved for editable-pane rules.
Defaultfalse

Allowed content

Body { }Literal code lines, kept verbatim.

Allowed in

cue.type { }canvas.code { }

Examples

lines{
def f(x):
    return x * 2
}
lines{
    return x * 2
}(
    highlight: true
)
lines{
def f(x):
    return undefined_name
}(
    error-lines: 2
    error-message: NameError: name 'undefined_name' is not defined
)
lines{
    return total / len(values)
}(
    indent: 1
    added-lines: 1
)
On this page
AttributesAllowed inExamples
Lines · Internote