Syntax Highlighter and Code Colorizer for Mediawiki
Easily highlight syntax in MediaWiki!
Contents
Overview
This is a MediaWiki Extension for syntax highlighting. It is simple and probably one of the best syntax highlighters in the market. This plugin integrates Alex Gorbatchev’s Syntax Highlighter Tool : Alex’s Site. Full Support for :
- Bash/shell
- C#
- C++
- CSS
- Delphi
- Diff
- Groovy
- JavaScript
- Java
- Perl
- PHP
- Plain Text
- Python
- Ruby
- Scala
- SQL
- Visual Basic
- XML
Download
Download and unzip in your /extensions MediaWiki folder:
ZIP: syntax-highlighter-code-colorizer.zip for MediaWiki
Installation
- Unzip the Syntax Highlighting Extension file in your MediaWiki “extensions/” Folder
- in your LocalSettings.php add the line =
require_once("extensions/syntax-highlighter-code-colorizer/syntax-highlighter-mediawiki.php");
Usage
Just surround your code like this:
<pre class="brush:[code-alias]"> …Your Code Here </pre>
replace the "[code-alias]" segment with the type of code you have. See all the available brush aliases. For Example, PHP would be like this:
<pre class="brush:php"> …Your PHP Code Here </pre>
Examples
C#
// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
Java
class Dog
{
public Dog(String aType)
{
System.out.println("I am a Dog");
}
}
public class MainClass
{
public static void main(String[] a)
{
Dog d = new Dog("a");
Class objectType = d.getClass();
System.out.println(objectType.getName());
}
}
Bash / Shell
/usr/bin/svnadmin hotcopy /path/to/svn/repository /path/to/destination 2. 3.tar cvf /path/to/backup/svnbackup-`date +%Y-%m-%d`.tar /path/to/destination/* 4. 5./usr/local/bin/7z a -tbzip2 -v2g svnbackup-`date +%Y-%m-%d`.tar.bz2 /path/to/backup/svnbackup-`date +%Y-%m-%d`.tar
More Details
The Syntax Highlighter Plugin has more configurable options. Go to = http://alexgorbatchev.com/wiki/SyntaxHighlighter
Tags: Developers, mediawiki, plugin

[...] Read More and Download : http://www.lastengine.com/syntax-highlighter-code-colorizer-mediawiki/ [...]
Awesome, I’m using this now!
[...] Mon Wiki local comporte plusieurs rubriques dont la majorité des pages sont des tutoriaux et des prises de notes liés à du code informatique (langage Action Script 3, PHP5, HTML, Java, CSS, XML, etc..). Mais malheureusement MediaWiki ne gère pas la coloration syntaxique nécessaire pour se repérer dans des longues séries de code. Pour cela j’utilise l’extension Syntax Highlighter Code Colorizer for Mediawiki. [...]
what are the requirements?
I did all but not found.
[...] Highlighter and Code Colorizer. Coloreador de código (para cuando usamos lenguajes de [...]
Could I overwrite all tags to automatically have syntax highlighting?
For anyone who had the same question as I, I wrote an extension to look up the category and switch through the possible values then replace the pre tag with the corresponding language.
Hey i use php4.1.
I am not able to use this. Please help me. Is there a php4 compatable one?