<program>

The <program> tag displays a source-code listing, usually with syntax highlighting based on its language attribute. The code itself may appear directly or inside a <code> child.

A program can also include pieces such as <preamble>, <postamble>, <tests>, or <stdin> to describe setup and execution details.

Syntax

Attributes

Attributes for <program>
AttributeRequired?Values
add-files = "…"optionalstring​
autorun = "…"optional"yes"​"no"​
chatcodes = "…"optional"yes"​"no"​
codelens = "…"optional"yes"​"no"​
codetailor = "…"optional"all"​"incorrect"​
codetailor-fallback = "…"optionalstring​
compile-also = "…"optionalstring​
compiler-args = "…"optionalstring​
component = "…"optionalstring​
database = "…"optionalstring​
datafile = "…"optionalstring​
download = "…"optional"yes"​"no"​
extra-compiler-args = "…"optionalstring​
filename = "…"optionalstring​
hidecode = "…"optional"yes"​"no"​
highlight-lines = "…"optionalstring​
include = "…"optionalstring​
interactive = "…"optional"codelens"​"activecode"​"no"​
interpreter-args = "…"optionalstring​
label = "…"optionalstring​
language = "…"optionalstring​
line-numbers = "…"optional"yes"​"no"​
linker-args = "…"optionalstring​
margins = "…"optionalstring​
pck = "…"optionalstring​
scene = "…"optionalstring​
starting-step = "…"optionalstring​
timelimit = "…"optionalstring​
width = "…"optionalstring​
xml:id = "…"optionalstring​

Children

The following may appear as children: <checkpoint> <code> <postamble> <preamble> <stdin> <tests> Text

Parents

This element may appear as an immediate child of the following elements: <abstract> <acknowledgement> <activity> <algorithm> <answer> <appendix> <article> <aside> <assemblage> <biographical> <biography> <case> <chapter> <claim> <colophon> <computation> <conclusion> <context> <convention> <corollary> <data> <discussion> <example> <exercise> <exploration> <fact> <gi> <handout> <headnote> <hint> <historical> <identity> <insight> <introduction> <investigation> <lemma> <li> <listing> <note> <observation> <opinion> <page> <paragraphs> <postlude> <preface> <prelude> <problem> <project> <proof> <proposition> <question> <remark> <section> <sidebyside> <slide> <solution> <stack> <statement> <status> <subsection> <subslide> <subsubsection> <suggestion> <task> <technology> <theorem> <warning> <worksheet>

Examples