<displayDoenetML>
<displayDoenetML> shows a snippet of DoenetML source as text rather
than rendering it. The contents are reproduced verbatim — every tag,
attribute, and reference is preserved — and rendered with syntax highlighting
in viewers that support it.
The most common pattern is <pre> wrapping a <displayDoenetML> so
that whitespace and indentation are preserved. Use this when you want to
talk about DoenetML inside a DoenetML document without the document parsing
and executing the snippet you are explaining.
For an editor in which the viewer can change the source and see the preview,
use <codeEditor> instead. For short inline tag references,
use <tag>, <tage>, or <tagc>.
Attributes and Properties
Attributes for <displayDoenetML>
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <displayDoenetML name="d">
Other (8)
$d.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$d.disabledboolean. Whether this component is disabled and cannot be interacted with.
$d.fixedboolean. Whether this component's value is fixed and cannot be modified.
$d.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$d.texttext. The verbatim text content.
$d.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$d.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
Common to all components (4)
$d.doenetMLtext. The DoenetML source code that produced this component.
$d.hideboolean. Whether to hide this component from the rendered output.
$d.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$d.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Show a small DoenetML snippet
The children of <displayDoenetML> are rendered as text without being
parsed as DoenetML. Wrapping in <pre> preserves the newlines and
indentation.
Example: Show a single inline reference
<displayDoenetML> is also useful inline (here inside a <c>)
when you need a single reference or fragment to appear verbatim instead of
being expanded.
Example: Side-by-side source and rendering
Showing the source above the rendered output is the standard pattern for “here’s the code, here’s the result” walkthroughs.