Fandom

HTML & CSS Wiki

GeSHi

648pages on
this wiki
Add New Page
Comments0 Share
GeSHi Logo

GeSHi logo.

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 ExtensionEdit

This extension adds the <syntaxhighlight> tag to present formatted source code.

Before rev:50696, the <source> tag was used. It is still supported, but <syntaxhighlight> 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 <source> tag.

UsageEdit

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

The lang 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 lang attribute values:

ValueLanguage
abapABAP
actionscriptActionScript
adaAda
apacheApache Configuration
applescriptAppleScript
asmASM
aspActive Server Pages (ASP)
autoitAutoIt
bashBash
basic4glBasic4GL
bfBrainfuck
blitzbasicBlitz BASIC
bnfBackus-Naur Form
cC
c_macC (Mac)
caddclAutoCAD DCL
cadlispAutoLISP
cfdgCFDG
cfmColdFusion Markup Language
cilCommon Intermediate Language (CIL)
cobolCOBOL
cpp-qtC++ (Qt toolkit)
cppC++
csharpC#
cssCascading Style Sheets (CSS)
dD
delphiDelphi
diffDiff
divDIV
dosDOS batch file
dotDOT
eiffelEiffel
fortranFortran
freebasicFreeBASIC
generoGenero
gettextGNU internationalization (i18n) library
glslOpenGL Shading Language (GLSL)
gmlGame Maker Language (GML)
gnuplotgnuplot
groovyGroovy
haskellHaskell
hq9plusHQ9+
html4strictHTML
idlUno IDL
iniINI
innoInno
intercalINTERCAL
ioIo
javaJava
java5Java(TM) 2 Platform Standard Edition 5.0
javascriptJavaScript
kixtartKiXtart
klonecKlone C
klonecppKlone C++
latexLaTeX
lispLisp
lolcodeLOLCODE
lotusscriptLotusScript
luaLua
m68kMotorola 68000 Assembler
makemake
matlabMATLAB M
mircmIRC scripting language
mxmlMXML
mpasmMicrochip Assembler
mysqlMySQL
nsisNullsoft Scriptable Install System (NSIS)
objcObjective-C
ocaml-briefOCaml
ocamlOCaml
oobasOpenOffice.org Basic
oracle8Oracle 8 SQL
oracle11Oracle 11 SQL
pascalPascal
perper
perlPerl
php-briefPHP
phpPHP
pixelbenderPixel Bender
plsqlPL/SQL
povrayPersistence of Vision Raytracer
powershellWindows PowerShell
progressOpenEdge Advanced Business Language
prologProlo
providexProvideX
pythonPython
qbasicQBasic/QuickBASIC
railsRails
regWindows Registry
robotsrobots.txt
rubyRuby
rsplusR/S+
sasSAS
scalaScala
schemeScheme
scilabScilab
sdlbasicSdlBasic
smalltalkSmalltalk
smartySmarty
sqlSQL
tclTcl
teratermTera Term
textPlain text
thinbasicthinBasic
tsqlTransact-SQL
typoscriptTypoScript
vbVisual Basic
vbnetVisual Basic .NET
verilogVerilog
vhdlVHDL
vimVimscript
visualfoxproVisual FoxPro
visualprologVisual Prolog
whitespaceWhitespace
winbatchWinbatch
xmlXML
xorg_confXorg.conf
xppX++
z80ZiLOG Z80 Assembler

ExampleEdit

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

<source lang="html4strict">
<html>
   <body>
     TEXT
   </body>
</html>
</source>

produces:

<html>
   <body>
     TEXT
   </body>
</html>
<source lang="css">
body {
      background:black;
}
</source>

produces:

body {
      background:black;
}

External LinksEdit



This page uses Creative Commons Licensed content from Wikipedia (view authors).

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.