Wiki Syntax Highlighting

From Littledamien Wiki
Revision as of 18:20, 24 February 2012 by Video8 (talk | contribs)
Jump to navigation Jump to search

Use the SyntaxHighlight GeSHi extension.

Download and copy SyntaxHighlight GeSHi extension into the MediaWiki extensions folder.

Customization of the MediaWiki LocalSettings.php file:

$wgAllowUserJs  = true;
$wgAllowUserCss  = true;
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");

Basic usage:

<syntaxhighlight lang="specifyLanguageHere">
your code.
(closing syntaxhighlight tag)

CSS

From within the wiki search for "MediaWiki:Custom.css" or "MediaWiki:Geshi.css" or "MediaWiki:Monobook.css". This will load up the CSS page, which can then be edited to tweak the formatting of the code. More info at [Syntax Highlighting Discussion]