| |||||
SyntaxHighlight, formerly known as SyntaxHighlight_GeSHi, is an extension that adds syntax highlighting based on the Pygments syntax highlighting library.
Usage
<syntaxhighlight> code here </syntaxhighlight>
Parameters
lang=- The code's language to determine the highlighting algorithm. For a full list of supported languages, see the Pygments documentation.
line- Enables line numbers.
start=- Starting number for the line numbers, if
lineis enabled.
highlight=- Comma-separated list of lines to add background highlighting.
inline- Display the code block inline with surrounding text.
class=- Adds CSS classes to the code block to allow for additional styling.
style=- Adds inline CSS styles to the code block.
Examples
lang
<syntaxhighlight lang="css">
Result:
div.skill-table {
margin: 2.1rem;
border-collapse:collapse;
}
line
<syntaxhighlight lang="css" line>
Result:
div.skill-table {
margin: 2.1rem;
border-collapse:collapse;
}
start
<syntaxhighlight lang="css" line start=5>
Result:
div.skill-table {
margin: 2.1rem;
border-collapse:collapse;
}
highlight
<syntaxhighlight lang="css" highlight="1,4">
Result:
div.skill-table {
margin: 2.1rem;
border-collapse:collapse;
}
inline
<syntaxhighlight lang="css" inline>
Result:
div.skill-table { margin: 2.1rem; border-collapse:collapse; }