Extension:SyntaxHighlighter

{{Extension|templatemode=
 * name         = SyntaxHighlighter
 * status       = beta
 * type1        = tag
 * type2        =
 * hook1        = ParserFirstCallInit
 * hook2        = ParserAfterTidy
 * username     = seongjaelee
 * author       = Seong Jae Lee
 * description  = Allows source code to be syntax highlighted using SyntaxHighlighter.
 * image        =
 * imagesize    =
 * version      = 1.0
 * update       = 2012-1-12
 * mediawiki    = 1.18.0
 * php          =
 * license      = MIT
 * download     = {{GithubDownload|seongjaelee|SyntaxHighlighter}}
 * readme       =
 * changelog    =
 * parameters   =
 * tags         =  tag using the SyntaxHighlighter JavaScript library.

Usage
On a wiki page, you can now use "source" elements:

The lang parameter specifies which language you are using. The list of supporting languages are shown below. The parameters such as collapse and first-line are passed into SyntaxHighlighter parameters. To see all the parameters, please refer to the SyntaxHighlighter configuration page. To see how the source codes are rendered, please refer to the sample page.

Installation
The source code is hosted on github and versioned using the git tool (not SVN, like most of the extensions). So, you'll need git to download or update the sources. Once git is installed, you can download the extension issuing the following command in the extensions/ directory:

git clone git://github.com/seongjaelee/SyntaxHighlighter.git

That would create directory SyntaxHighlighter/, which contains the needed files, right under extensions/.

If you don't want to be bothered, you can just download the zip file from the following address:

https://github.com/seongjaelee/SyntaxHighlighter/zipball/master

Unzip the downloaded file in the extensions/ directory, and change the name of directory to SyntaxHighlighter/.

Finally, add the following to LocalSettings.php:

Many other syntax highlighting extensions also share  tag, so if you already use one, uncomment it from LocalSettings.php file.

Supporting Languages
Some of the supported languages and corresponding lang parameters are shown below. For the full list, please refer to the SyntaxHighlighter site.
 * C++ : cpp, c
 * C# : csharp, c-sharp
 * CSS : css
 * PHP : php
 * XML : xml, html, xhtml
 * Python : python, py
 * Java : java
 * JavaSscript : jscript, js, javascript