GeSHi

Generic Syntax Highlighter is a free software library that allows syntax highlighting of source code for several markup and programming languages. The program is written in PHP and is bundled or available as an add-on in popular web-based applications, such as Dokuwiki, Mambo, MediaWiki (see extension), phpBB and WikkaWiki. Wikipedia and HTML & CSS Wiki use GeSHi as its primary syntax highlighter.

MediaWiki Extension
This extension adds the  tag to present formatted source code.

Before rev:50696, the  tag was used. It is still supported, but  is recommended to avoid possible conflicts. The original syntax is used in some other languages, e.g. XML. Currently Wikia only supports the usage of the  tag.

Usage
The  (  on Wikia) tags allow the display of preformatted code modules but in addition they add coloring according to the code language settings. Like the  tags and the   tags, they preserve white space, that is, they depict the code module exactly as it was typed.

The  attribute must be specified in order to define which type of code language you are using. Each language has its own color highlighting.

Below lists supported code languages along with their appropriate  attribute values:

Example
Below are examples of the GeSHi syntax highlight effects on HTML and CSS markup languages.

produces:

produces: