Difference between revisions of "Widget:CodeExplorer"
From Coder Merlin
Line 31: | Line 31: | ||
<div class="merlin-code-explorer-container"> | <div class="merlin-code-explorer-container"> | ||
<div class="merlin-code-explorer-banner"> | <div class="merlin-code-explorer-banner"> | ||
<img class="merlin-code-explorer-banner-merlin-icon" src="/wiki/ | <img class="merlin-code-explorer-banner-merlin-icon" src="url(/wiki/resources/assets/MerlinRoundIcon.png" /> | ||
<img class="merlin-code-explorer-banner-language-icon" src="/wiki/images/thumb/3/3b/Swift-og.png/600px-Swift-og.png" /> | <img class="merlin-code-explorer-banner-language-icon" src="/wiki/images/thumb/3/3b/Swift-og.png/600px-Swift-og.png" /> | ||
</div> | </div> |
Revision as of 08:18, 14 June 2021
Parameters:
- uniqueID
- integer: id for editor, must be unique per page
- width
- integer|string: percentage (as string, e.g. "100%" or integer size in pixels), null for no change (full width)
- height
- integer|string: percentage (as string, e.g. "100%" or integer size in pixels), null for no change (~10 lines)
- lineNumbers
- boolean: true to display line numbers
- theme
- string: name of theme (which must be loaded via css)
- readOnly
- boolean: true if editing should be disabled
- mode
- string: language for highlighting (which must be loaded via js)
- initialCode
- string: initial code to place in editor
Example:
{{#widget:CodeExplorer |uniqueID=10 |width=null |height=null |lineNumbers=true |theme=vibrant-ink |readOnly=false |mode=swift |initialCode=func sayHello() { print("Hello, World!") } }}