Template:Highlight: Difference between revisions

From Leo's Notes
This page was last edited on 2 January 2022, at 10:07.
No edit summary
change terminal to console lexer
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#tag:syntaxhighlight
{{#tag:syntaxhighlight
|{{{code|{{{1|No code provided.}}}}}}
|{{{code|{{{1|No code provided.}}}}}}
|lang="{{{lang|{{{2|text}}}}}}"
|lang="{{#ifeq:{{{lang|{{{2|text}}}}}}|terminal|console|{{{lang|{{{2|text}}}}}}}}"
|class="mw-highlight-{{{lang|{{{2|text}}}}}}"
|class="mw-highlight-{{{lang|{{{2|text}}}}}}"
|style="{{#if:{{{style|}}}| {{{style}}} |}}"
|style="{{#if:{{{style|}}}| {{{style}}} |}}"
|highlight="{{{highlight|{{{3|}}}}}}"
|highlight="{{{highlight|{{{3|}}}}}}"
|enclose="div"
|inline
|{{#if: {{{line|}}}|line=line}}
|{{#if: {{{line|}}}|line=line}}
}}
}}<noinclude>
<templatedata>
{
"params": {
"lang": {
"aliases": [
"2"
],
"label": "lang",
"description": "language of the code to highlight",
"example": "terminal",
"type": "string",
"default": "terminal",
"autovalue": "terminal",
"suggested": true
},
"code": {
"aliases": [
"1"
],
"label": "code",
"description": "code to highlight",
"required": true,
"type": "string",
"autovalue": ""
},
"style": {
"label": "style",
"description": "custom CSS style",
"type": "string",
"autovalue": ""
},
"highlight": {
"aliases": [
"3"
],
"autovalue": ""
},
"line": {
"label": "line",
"description": "line to highlight",
"type": "number"
}
},
"description": "Syntax highlights a chunk of code or text",
"paramOrder": [
"code",
"lang",
"line",
"style",
"highlight"
],
"format": "block"
}
</templatedata>
</noinclude>

Latest revision as of 10:07, 2 January 2022

No code provided.

Syntax highlights a chunk of code or text

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
codecode 1

code to highlight

Auto value
Stringrequired
langlang 2

language of the code to highlight

Default
terminal
Example
terminal
Auto value
terminal
Stringsuggested
lineline

line to highlight

Numberoptional
stylestyle

custom CSS style

Auto value
Stringoptional
highlighthighlight 3

no description

Auto value
Unknownoptional