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 SyntaxHighlighter javascript library.

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

To see how the source codes are rendered, please refer the sample page.

Installation
The source code is hosted on github and versioned using the git tool (not SVN, as 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 SyntaxHighlighter site.
 * C++ : cpp, c
 * C# : csharp, c-sharp
 * CSS : css
 * PHP : php
 * XML : xml, html, xhtml
 * Python : python, py
 * Java : java
 * Javascript : jscript, js, javascript