Item8185: Update DpSyntaxHighlighterPlugin to use latest version (2.0.320) of SyntaxHighlighter

Priority: Enhancement
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: DpSyntaxHighlighterPlugin
Reported By: Foswiki:Main.JeffVStein
Waiting For: Main.AndrewJones
Last Change By: AndrewJones
The newer version of the SyntaxHighlighter includes support for copying code text again (broken by Flash 10?) It also has a slightly different look and feel. Attached is a diff of my changes to the DpSyntaxHighlighterPlugin after upgrading the code. The scripts and styles folders just need to be copied from the release and pasted to the /path/to/Foswiki/pub/System/dp.SyntaxHighlighter/ folder.

New options for CODE blocks
Example Description
nowrap="on" Prevents line wrapping
ruler="on" Adds a line character ruler to the top
smart-tabs="on" Semi-intelligent tabbing (Demo)
tab-size="value" Set the tab size for tab expansion
highlight="1,2,3" Highlight specific lines of code

New options for WebPreferences
Example Description
DPSYNTAXHIGHLIGHTERPLUGIN_THEME = Default The theme to use for code highlighting - several are included with SyntaxHighlighter
DPSYNTAXHIGHLIGHTERPLUGIN_HIDE_ABOUT = ON Hides the "About" button if enabled.
DPSYNTAXHIGHLIGHTERPLUGIN_HIDE_PRINT = ON Hides the "Print" button if enabled.
DPSYNTAXHIGHLIGHTERPLUGIN_SPACEWIDTH = 8 Number of pixels to use for a space when expanding tabs. Normally discovered through javascript but may be incorrect depending on the wiki skin. 8 is a good value for PatternSkin in my environment.

-- JeffVStein - 22 Jun 2009

Sorry I didn't see this sooner.

I didn't want to update to version 2 as it had a weird license ("Donationware"), but it seems it is not under LGPL3, which I think is an acceptable open source license.

Thanks for the patch and the docs.

I will check this in in the near future.

-- AndrewJones - 05 Nov 2009

I have checked this in and uploaded a new version.

Thanks for your contribution. By the way, if you have other contributions you might want to request access to SVN? Foswiki is very open to new developers. See RequestAccessToSubversion for more info.

-- AndrewJones - 08 Nov 2009
I Attachment Action Size Date Who Comment
dppatch.diffdiff dppatch.diff manage 5 K 22 Jun 2009 - 20:06 JeffVStein Updated diff of my changes against trunk (Fixed issues with having the wrong lang names vs. the SyntaxHighlighter values)
Topic revision: r5 - 08 Nov 2009, AndrewJones
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy