Installing GeSHi

From Cosmin's Wiki

Jump to: navigation, search

Installation

It is quite often that you want to add source code examples to a wiki page. And, of course, you're used to having syntax highlighted. For this I use GeSHi - Generic Syntax Highlighter. Here's what you need to have it installed (quite easy):

There are mainly 2 ways of having GeSHi installed:

  • download it from here
  • install it using PEAR

For the first item - there's nothing to discuss (download, copy to the extensions folder of your mediawiki and that's it.

For the PEAR installation:

  • you need to have the PEAR module installed on your computer
sudo apt-get install php-pear
  • take care to use the correct version of PEAR. Currently, the minimum version of PEAR usable with this channel is v1.6.2. For this you would simply do:
pear upgrade pear
pear channel-discover mediawiki.googlecode.com/svn
  • proceed now to installing geshi:
pear install mediawiki/geshi.php
  • pay attention that mediawiki/geshi also depends on mediawiki:StubManager (you also need to install this one)
  • last thing that you need to do is to modify your Localsettings.php file, adding the following lines:

require_once( "extensions/StubManager/StubManager.php");
require_once( "extensions/geshi/geshi.php");

Using GeSHi

Supported languages

These are the languages known by GeSHi that can be used in the lang parameter:

CodeLanguage
abapABAP
actionscriptActionScript
adaAda
apacheApache Log
applescriptAppleScript
asmASM
aspActive Server Pages (ASP)
autoitAutoIt
bashBash
basic4glBasic4GL
blitzbasicBlitz BASIC
bnfBackus-Naur Form
cC
c_macC (Mac)
caddclAutoCAD DCL
cadlispAutoLISP
cfdgCFDG
cfmColdFusion
cpp-qtC++ (Qt toolkit)
cppC++
csharpC#
cssCascading Style Sheets (CSS)
dD
delphiDelphi
diffDiff
divDIV
dosDOS batch file
dotDOT
eiffelEiffel
fortranFortran
freebasicFreeBASIC
generoGenero
gmlGame Maker Language (GML)
groovyGroovy
haskellHaskell
html4strictHTML
idlUno IDL
iniINI
innoInno
ioIo
javaJava
java5Java(TM) 2 Platform Standard Edition 5.0
javascriptJavaScript
latexLaTeX
CodeLanguage
lispLisp
luaLua
m68kMotorola 68000 Assembler
matlabMATLAB M
mircmIRC scripting language
mpasmMicrochip Assembler
mysqlMySQL
nsisNullsoft Scriptable Install System (NSIS)
objcObjective-C
ocaml-briefOCaml
ocamlOCaml
oobasOpenOffice.org Basic
oracle8Oracle 8 SQL
pascalPascal
perper
perlPerl
php-briefPHP
phpPHP
plsqlPL/SQL
pythonPython
qbasicQBasic/QuickBASIC
railsRails
regWindows Registry
robotsrobots.txt
rubyRuby
sasSAS
schemeScheme
sdlbasicSdlBasic
smalltalkSmalltalk
smartySmarty
sqlSQL
tclTcl
textPlain text
thinbasicthinBasic
tsqlTransact-SQL
vbVisual Basic
vbnetVisual Basic .NET
vhdlVHDL
visualfoxproVisual FoxPro
winbatchWinbatch
xmlXML
xppX++
z80ZiLOG Z80 Assembler