User Tools

Site Tools


sytaxhighlighter

SyntaxHighLighter

Feb 2017

SyntaxHighLigher is a plugin for DokuWiki. What this plugin does is to correctly format text where formatting would otherwise be lost (Python for an example).

The SyntaxHighLighter uses brushes to select the formatting of the text, so if you wish to show XML code, then you select the XML brush, as shown below.

<sxh [XML][; options for SyntaxHighlighter]>
... code/text ...
</sxh>


This is a great tool because it can take code that looks like the following (this is Python)

if len(sys.argv)>1:
  WaitTime = int(sys.argv[1])/float(1000)
else:
  WaitTime = 10/float(1000)


So yes it is readable, and stands out, but the formatting is much nicer if it looks similar to how it would in an actual Python development environment, like this:
<sxh [py][; options for SyntaxHighlighter]> if len(sys.argv)>1:   WaitTime = int(sys.argv[1])/float(1000) else:   WaitTime = 10/float(1000) </sxh>


Available Brush Types


Brush name                Brush aliases          File name

ActionScript3             as3, actionscript3                 shBrushAS3.js
Bash/shell                bash, shell                        shBrushBash.js
ColdFusion                cf, coldfusion                     shBrushColdFusion.js
C#                        c-sharp, csharp                    shBrushCSharp.js
C++                       cpp, c                             shBrushCpp.js
CSS                       css                                shBrushCss.js
Delphi                    delphi, pas, pascal                shBrushDelphi.js
Diff                      diff, patch                        shBrushDiff.js
Erlang                    erl, erlang                        shBrushErlang.js
Groovy                    groovy                             shBrushGroovy.js
JavaScript                js, jscript, javascript            shBrushJScript.js
Java                      java                               shBrushJava.js
JavaFX                    jfx, javafx                        shBrushJavaFX.js
Perl                      perl, pl                           shBrushPerl.js
PHP                       php                                shBrushPhp.js
Plain Text                plain, text                        shBrushPlain.js
PowerShell                ps, powershell                     shBrushPowerShell.js
Python                    py, python                         shBrushPython.js
Ruby                      rails, ror, ruby                   shBrushRuby.js
Scala                     scala                              shBrushScala.js
SQL                       sql                                shBrushSql.js
Visual Basic              vb, vbnet                          shBrushVb.js
XML                       xml, xhtml, xslt, html, xhtml      shBrushXml.js
sytaxhighlighter.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1