Steps for setting up GeSHi (Generic Syntax Highlighter) on MediaWiki:
- Download GeSHi (Generic Syntax Highlighter).
- Upload geshi.php and the geshi folder to your MediaWiki extensions folder.
- Create GeSHiHighlight.php using this source code.
- Copy the following line to your LocalSettings.php file.
include("extensions/GeSHiHighlight.php");
- 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!
No, its not like that..
To get the real syntax highlighting working should use:
The way you have posted will just preformat text.
ok , my comments got hidden:: as i said you should use the following code:
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
I still can’t believe how many people are using that chunk of php! :)
Heres a more up-to-date source for the highlight extension:
http://www.mediawiki.org/wiki/Extension:GeSHiHighlight
(The version on intel-research is quite old, has my old email address, and there are some bugs/features that have been worked out — mostly by other people — I’m really not a php programmer, so there were a number of improvements.)