Code listings
Code listings can be used to show programming code that ranges over multiples lines.
Example
Attributes
The codelisting element supports the following attributes:
| Attribute | Type | Default | Description |
|---|---|---|---|
firstlinenumber |
xs:nonNegativeInteger |
1 |
The line number that gets assigned to the first line of code in the code listing which is displayed. By default, the line numbers start with one. |
highlight |
LineNumberRangeList |
A space-separated list of individual line numbers or line number ranges of the code to highlight. These lines are displayed differently than the other lines so that they can be distinguished by the user. By default, no lines are highlighted. | |
lang |
CodeLanguage |
plaintext |
Short string identifying the language of the code content, such as "plaintext" (no language), "xml", "java" or "cpp". |
name |
xs:Name |
- | Name of this element. Must be unique among all element names in this course variant. |
tags |
TokenList |
Whitespace-separated list of tags of this element. |