Template:CodeExplorer

From Coder Merlin
Revision as of 14:51, 9 March 2023 by Yong-yan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Parameters:

exerciseID
integer: exercise id for editor, must be unique per page. REQUIRED.
width
integer|string: percentage (as string, e.g. "100%" or integer size in pixels), null for no change (full width). DEFAULT: null
height
integer|string: percentage (as string, e.g. "100%" or integer size in pixels), null for no change (~10 lines). DEFAULT: null
lineNumbers
boolean: true to display line numbers. DEFAULT: true
theme
string: name of theme (which must be loaded via css). DEFAULT: vibrant-ink
readOnly
boolean: true if editing should be disabled. DEFAULT: false.
language
string: language for compiling and highlighting (which must be loaded via js). REQUIRED.
initialCode
string: initial code to place in editor. DEFAULT: <empty>

Example:

{{CodeExplorer
|exerciseID=10
|width=null
|height=null
|lineNumbers=true
|theme=vibrant-ink
|readOnly=false
|language=swift
|initialCode=
func sayHello() {
    print("Hello, World!")
}
}}