Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

Extension:SyntaxHighlight GeSHi

From Gamepedia Help Wiki
Jump to: navigation, search
SyntaxHighlight GeSHi
Version 2.0
Author(s) Brion Vibber, Tim Starling, Rob Church, Niklas Laxström, Ori Livneh and Ed Sanders
Extension link MediaWiki.org
Description
Provides syntax highlighting <syntaxhighlight> using Pygments - Python syntax highlighter

SyntaxHighlight GeSHi (also known as simply SyntaxHighlight) is an extension that adds syntax highlighting based on the Pygments syntax highlighting library.

Usage[edit | edit source]

<syntaxhighlight>
code here
</syntaxhighlight>

Parameters[edit | edit source]

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 line is 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[edit | edit source]

lang[edit | edit source]

<syntaxhighlight lang="css">

Result:

div.skill-table {
    margin: 2.1rem;
    border-collapse:collapse;
}

line[edit | edit source]

<syntaxhighlight lang="css" line>

Result:

1 div.skill-table {
2     margin: 2.1rem;
3     border-collapse:collapse;
4 }

start[edit | edit source]

<syntaxhighlight lang="css" line start=5>

Result:

5 div.skill-table {
6     margin: 2.1rem;
7     border-collapse:collapse;
8 }

highlight[edit | edit source]

<syntaxhighlight lang="css" highlight="1,4">

Result:

div.skill-table {
    margin: 2.1rem;
    border-collapse:collapse;
}

inline[edit | edit source]

<syntaxhighlight lang="css" inline>

Result: div.skill-table { margin: 2.1rem; border-collapse:collapse; }

See also[edit | edit source]