Template:Highlight: Difference between revisions
From Leo's Notes
This page was last edited on 2 January 2022, at 10:07.
mNo edit summary |
change terminal to console lexer |
||
| (6 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|}}}}}}" | ||
| | |inline | ||
|{{#if: {{{line|}}}|line=line}} | |{{#if: {{{line|}}}|line=line}} | ||
}} | }}<noinclude> | ||
<noinclude> | |||
<templatedata> | <templatedata> | ||
{ | { | ||
| Line 18: | Line 17: | ||
"label": "lang", | "label": "lang", | ||
"description": "language of the code to highlight", | "description": "language of the code to highlight", | ||
"example": " | "example": "terminal", | ||
"type": "string", | "type": "string", | ||
"default": " | "default": "terminal", | ||
"autovalue": " | "autovalue": "terminal", | ||
"suggested": true | "suggested": true | ||
}, | }, | ||
| Line 40: | Line 39: | ||
"autovalue": "" | "autovalue": "" | ||
}, | }, | ||
"highlight": {}, | "highlight": { | ||
"aliases": [ | |||
"3" | |||
], | |||
"autovalue": "" | |||
}, | |||
"line": { | "line": { | ||
"label": "line", | "label": "line", | ||
| Line 47: | Line 51: | ||
} | } | ||
}, | }, | ||
"description": "Syntax highlights a chunk of code or text" | "description": "Syntax highlights a chunk of code or text", | ||
"paramOrder": [ | |||
"code", | |||
"lang", | |||
"line", | |||
"style", | |||
"highlight" | |||
], | |||
"format": "block" | |||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 10:07, 2 January 2022
No code provided.
Syntax highlights a chunk of code or text
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| code | code 1 | code to highlight
| String | required |
| lang | lang 2 | language of the code to highlight
| String | suggested |
| line | line | line to highlight | Number | optional |
| style | style | custom CSS style
| String | optional |
| highlight | highlight 3 | no description
| Unknown | optional |