ScrewTurn Syntax Highlighter


This is a lightweight Syntax Highlighter plugin for ScrewTurn Wiki. The plugin uses the Lonwas Highlighter, by Thomas Johansen and Christian Nordbakk, which currently supports 23 languages by default and is extensible through the use of an XML file.

Note: The Syntax Highlighter is only being used as a lightweight highlighter. This means that it does not support some of the more advanced features, such as line numbering or keyword hyperlinks.


To highlight code simply surround the desired code with <code language> and </code>, where “language” denotes the language of the code E.G. C#.

Example: <code c#>public static void TestMethod() { return; }</code>

The <code> tags are parsed during phase1 (prior to the wiki parsing). During this time — apart from the syntax highlighting — the <code> tag is replaced with <pre class=“code language”>, where language denotes the language entered. This allows you to alter the display of the code, both for all code blocks and specific languages, through the use of CSS.

A few rules are applied to the language name when it is outputted as the class name of the pre tag.

  • The language name is converted to all lower cases.
  • White spaces are stripped.
  • # is converted to “sharp”.
  • . is converted to “dot”.
  • + is converted to “plus”.

For example, this means <code c#> will produce <pre class=“code csharp”>.

Note: <nowiki> tags are placed around the code so that any wiki syntax in the code will not be parsed by the wiki engine.

Supported languages: ASPX, C, C++, C#, COBOL, Eiffel, Fortran, Haskell, HTML, Java, JavaScript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NETXML.


  1. Download Syntax Highlighter.
  2. Extract the folder into your root wiki directory.
    • Definitions.xml should go into your root directory.
    • Lonwas.Highlight.dll should go into your bin directory.
  3. Log into your Wiki’s administration panel.
  4. Click on the Providers tab.
  5. Under Add new Providers click on browse and select TimBellette.ScrewTurnSyntaxHighlighter.dll and click upload.
    • If your Definitions.xml file is not in the default location or has been renamed, it will show up as disabled.
      1. Click Syntax Highlighter in your providers’ list and click Configure.
      2. Enter the URL of the uploaded Definitions.xml file (E.G. and click save.
      3. Click Enable to enable the Syntax Highlighter.
  6. You’re Done.


  • [Version 1.2, released 2007-06-16]
    • Added default configuration setting.
  • [Version 1.1, released 2007-06-16]
    • Fixed wiki rendering bug.
    • Fixed CSS class names bug.
  • [Version 1.0, released 2007-06-15]
    • First released.


Copyright ©2007 Tim Bellette. All rights reserved.