Design Simply

Simplicity in design, photography & code.


How to Setup Syntax Highlighting in MediaWiki

Steps for setting up GeSHi (Generic Syntax Highlighter) on MediaWiki:

  1. Download GeSHi (Generic Syntax Highlighter).
  2. Upload geshi.php and the geshi folder to your MediaWiki extensions folder.
  3. Create GeSHiHighlight.php using this source code.
  4. Copy the following line to your LocalSettings.php file.
    include("extensions/GeSHiHighlight.php");
  5. Add code to a MediaWiki page using <pre> tags.
    <php><?php echo "Hello World!"; ?></php>
    

More information about GeSHI can be found at http://qbnz.com/highlighter/.

Edit: Oops. I had posted the last step with <pre> tags instead of <php>. I’ve fixed it now. Thanks override!

Related Posts

Add to your del.icio.us Add to del.icio.us Digg this storyDigg this

3 Responses to “How to Setup Syntax Highlighting in MediaWiki”

  1. override Says:

    No, its not like that..
    To get the real syntax highlighting working should use:

    The way you have posted will just preformat text.

  2. override Says:

    ok , my comments got hidden:: as i said you should use the following code:

  3. override Says:

    ok, it happened again, it sucks i cannot see a preview before posting, anyway , instead of “” you have to use “” with its respective “” to close the block.

    cheers

Leave a Reply



Copyright © 2000-2008 Sheri Bigelow. Proudly powered by WordPress and hosted by bluehost.
Log in. Valid XHTML 1, CSS 2. Entries (RSS) and Comments (RSS).