Code in the Wiki

From SRL Wiki

Jump to: navigation, search

Adding code to the wiki is extremely simple.

This is a PHP example.

<?php
    $v = "string";    // sample initialization
?>
html text
<?
    echo $v;         // end of php code
?>

How would you use this in your article? It is very simple.

<source lang="php">
<?php
    $v = "string";    // sample initialization
?>
html text
<?
    echo $v;         // end of php code
?>
</source>

PHP can be replaced by most other languages.

Supported languages

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

Note that not all these languages may be supported, but most of them are.

CodeLanguage
abapABAP
actionscriptActionScript
adaAda
apacheApache Log
applescriptAppleScript
asmASM
aspActive Server Pages (ASP)
autoitAutoIt
bashBash
basic4glBasic4GL
bfBrainfuck
blitzbasicBlitz BASIC
bnfBackus-Naur Form
cC
c_macC (Mac)
caddclAutoCAD DCL
cadlispAutoLISP
cfdgCFDG
cfmColdFusion
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
CodeLanguage
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
prologProlog
providexProvideX
pythonPython
qbasicQBasic/QuickBASIC
railsRails
regWindows Registry
robotsrobots.txt
rubyRuby
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
++++++++++        initialises cell zero to 10
[
   >+++++++>++++++++++>+++>+<<<<-
]                 this loop sets the next four cells to 70/100/30/10 
>++.              print   'H'
>+.               print   'e'
+++++++.                  'l'
.                         'l'
+++.                      'o'
>++.                      space
<<+++++++++++++++.        'W'
>.                        'o'
+++.                      'r'
------.                   'l'
--------.                 'd'
>+.                       '!'
>.                        newline
Personal tools