Source Highlighting Plugin

Highlight your source code! This plugin uses highlight.

Syntax Rules

Enclose your code within <highlight></highlight> tags.

Include the following options within the opening highlight tag:
  • lang - Specify the code language to highlight; use the language's extension (defaults to r).
  • bgcolor - Specify the backround color (defaults to light blue).
  • keywords - Specify additional keywords (quoted and semicolon delimited) to highlight. (ex: keywords="upData;radFunction")

Available Languages

See this for the full listing. I'll try to get the extensions for each language.


a<-function(data) {

a<-function(data) {

<highlight bgcolor=#cccccc lang=py keywords="write;xreadlines">
# this script replaces all occurrences of char old with char new
import os, sys
new=' '
for s in input.xreadlines():

SourceHighlighting Error: unknown error

SourceHighlightingPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %EMPTYPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = This plugin highlights source code.

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/SourceHighlightingPlugin.txt Plugin topic
    data/TWiki/SourceHighlightingPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/ Plugin Perl module
  • Test if the plugin is correctly installed:
    • (describe tests here)

Plugin Info

Plugin Author: ColeBeck
Plugin Version: 10 Jan 2006 (V1.200)
Change History:  
7 Oct 2005: Initial version
11 Oct 2005: Can highlight any language available + bgcolor
10 Jan 2002: Can specify additional keywords to highlight (JS)
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home:  

-- ColeBeck - 11 Oct 2005
Topic revision: r8 - 29 Jul 2008, ColeBeck

This site is powered by FoswikiCopyright © 2013-2020 by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback