Wikka Documentation : SyntaxHighlighter

HomePage :: Index :: RecentChanges :: Search :: Login/Register
[777] Latest edit on 2008-02-21 02:21:28 by DarTar [[m] layout]


Additions:
See Wikka in action:
NOTE
This feature is available since:
WikkaWiki 1.1.6.0
This is the documentation page for the syntax highlighter.

Deletions:
GeSHi is included in Wikka since version 1.1.6.0.
See Wikka in action:
This is the documentation page for the syntax highlighter.



[776] Edited on 2008-02-21 02:20:07 by DarTar [examples]


Additions:
Usage: %%(formatter[;line-number][;filename]) code %%
If geshi_line_numbersin the ConfigurationOptions is enabeld, simply add a ;line-number after the language formatter to display line-numbers starting at line-number.
%%(php;15)
<?php
echo "Hello, World!";
?>
%%
  1. echo "Hello, World!";
  2. If you specify a ##filename##, this will be used for downloading the code.
  3. ~##""
(php;15;{{color c="red" text="test.php"}})<br /><?php<br />echo "Hello, World!";<br />?><br />
""##
(php;15;test.php)
echo "Hello, World!";

Available formatters

GeSHi formatters
List of available code formatters
since 1.1.6.4
LanguageFormatterLanguageFormatterLanguageFormatter
ActionscriptactionscriptADAadaApache Logapache
AppleScriptapplescriptASMasmASPasp
AutoITautoitBashbashBlitzBasicblitzbasic
bnfbnfCcC for Macsc_mac
C#csharpC++cppC++ (+QT)cpp-qt
CAD DCLcaddclCadLispcadlispCFDGcfdg
ColdFusioncfmCSScssDd
DelphidelphiDiff-OutputdiffDIVdiv
DOSdosEiffeleiffelFortranfortran
FreeBasicfreebasicGMLgmlGroovygroovy
HTMLhtml4strictINIiniInno Scriptinno
IoioJava 5java5Javajava
JavascriptjavascriptLaTeXlatexLisplisp
LualuaMatlabmatlabmIRC Scriptingmirc
Microchip AssemblermpasmMicrosoft RegistryregMySQLmysql
NSISnsisObjective CobjcOpenOffice BASICoobas
Objective CamlocamlObjective Caml (brief)ocaml-briefOracle 8oracle8
PascalpascalPerlperlPHPphp
PHP (brief)php-briefPL/SQLplsqlPythonphyton
Q(uick)BASICqbasicrobots.txtrobotsRubyruby
SASsasSchemeschemesdlBasicsdlbasic
SmartysmartySQLsqlTCL/iTCLtcl
T-SQLtsqlTexttextthinBasicthinbasic
UnoidlidlVB.NETvbnetVHDLvhdl
Visual BASICvbVisual Fox ProvisualfoxproWinBatchwinbatch
XMLxmlZiLOG Z80 Assemblerz80
built-in:
%%(php;1) PHP code with line-numbers and filename%%:
%%(php;1;test.php)
The built-int highlighter does not supported line numbering and is maintained for backwards-compatibility.

Deletions:
Usage: %%(formatter[;line-number]) code %%
If "geshi_line_numbers" in the ConfigurationOptions is enabeld, simply add a ;#number after the language name to have line-numbers starting at #number. See the php-example below.
If you specify a filename, this will be used for downloading the code.
Available formatters
The following formatters are available:
from GeSHi:
built-in:
%%(php;1;test.php)
will result in a downloadable file called test.php.txt - line number starting on line 1 (note, this won't work on wikkawiki.org for now!)
Line numbers are not supported here.



[289] Edited on 2006-11-19 08:59:35 by YanB [update link to central site + cat.]


Additions:
HomePage
CategoryEN

Deletions:
Wikka Documentation
CategoryDocumentation



[182] The oldest known version of this page was created on 2006-08-01 11:47:39 by DarTar [changing folder for miniscreenshots]

History of recent changes for SyntaxHighlighter
Wikka Documentation

Syntax Highlighting for Code Blocks

GeSHi is included in Wikka since version 1.1.6.0.

See Wikka in action:
See also:
This is the documentation page for the syntax highlighter.

Code highlighting sample
 

GeSHi is now hooked into Wikka.

Usage: %%(formatter[;line-number]) code %%

Line-numbers
If "geshi_line_numbers" in the ConfigurationOptions is enabeld, simply add a ;#number after the language name to have line-numbers starting at #number. See the php-example below.

Linking to online documention
If you click on a function name, you get to the entry of this function in the online manual of the language (only for some languages). You can try it out with the php-example below.

Setting a file name for download
If you specify a filename, this will be used for downloading the code.

Available formatters
The following formatters are available:

from GeSHi:

built-in:

Note that GeSHi syntax highlighting takes precedence over built-in syntax highlighting.

Examples


highlighted with GeSHi

%%(php;1) PHP code with line-numbers%%:
  1. <?php
  2. $text = "Hello, World!";
  3. print $text;
  4. ?>


%%(css) CSS code%%
body {
    font-family: "Trebuchet MS", Georgia, serif;
    font-size: .9em;
    line-height: 1.4em;
    font-weight: normal;
    color: #000000;
    background-image: url(../images/wikkalight.jpg);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #000;
    margin: 0px;
}


%%(javascript;129) JavaScript code starting on line 129%%
  1. function fKeyDown()
  2. {
  3.     if (event.keyCode == 9)
  4.     {
  5.         event.returnValue = false;
  6.         document.selection.createRange().text = String.fromCharCode(9);
  7.     }
  8. }


%%(php;1;test.php)
will result in a downloadable file called test.php.txt - line number starting on line 1 (note, this won't work on wikkawiki.org for now!)


Wikka built-in highlighter

Line numbers are not supported here.

%%(ini) INI file contents%%:
; Menu specification file for Opera 7.0

[Version]
File Version=2

[Info]  #background info
Name=Munin++ Menu
Description=Munin++ Menu
Author=NonTroppo (originally by Rijk van Geijtenbeek)
Version=1.9


%%(email) Email message%%:
Hi!
>>>> My Llama loves foot massage.
>>> You really think so?
>> Yes, I know he does.
>Are you sure?

Of course, yes!

Mr. Scruff


%%code%%:
int main(int arc,char **argv)
{
	printf("Hello, %s!
", (argc>1) ? argv[1] : "World");
	return 0;
}




CategoryDocumentation
Creative Common Attribution-ShareAlike License
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.7334 seconds