Entries for month: November 2009

New and (Much) Improved SyntaxHighlighter Plugin for Mango

ColdFusion , Mango Blog , CFML 44 Comments »

A little while ago, I released a SyntaxHighlighter Plugin for Mango Blog. Although I was fairly happy with my first Mango plugin, I still thought there was room for improvement. Certain things about it bugged me, so I finally dug in and did a complete rewrite. So I am very pleased to release version 2.0 of the plugin! Here is a list of the improvements introduced in this version:

  • It uses the latest version (2.1.364) of Alex Gorbatchev's SyntaxHighlighter script. The previous version of the plugin used the deprecated version 1.5.1.
  • I eliminated the dependency on the syntaxhl TinyMCE plugin (which added a syntaxhiglighter button to the WYSIWYG editor) to do the syntax highlighting. I found that using syntaxhl was kind of clunky and now you can simply insert code by pasting it directly into the editor between a pair of [code][/code] tags (without disabling TinyMCE or going into "source view"). Therefore, this new version won't add a syntaxhighlighter button to the editor. Please read the README file (included in the download) for more details on how to use the plugin.
  • Along with the latest version of the SyntaxHighlighter script comes configurable themes to change the look of the syntax highlighting as well as several new syntax "brushes" (including Groovy, Scala, Erlang, and a few others).
  • "Legacy Mode" can be enabled for those who used the previous version of my plugin (or just SyntaxHighlighter 1.5.1 directly) and have a lot of existing posts. This setting will make the plugin backward-compatible.
  • The plugin itself was refactored to take advantage of the enhancements to Mango's plugin architecture that were introduced with version 1.3 of Mango.

I hope people find this useful. There are more details in the README file included with the plugin, so make sure to read that so you can take advantage of the new features. People upgrading from version 1 of my plugin should especially read it.

Please note: this plugin was made so that authors wouldn't have to switch back and forth between WYSIWYG mode and HTML mode to add code blocks in their posts. This plugin will ONLY work properly if the code blocks are entered in WYSIWIG mode (you should see a tool bar at the top of the content editor). If the top of your content editor looks like this:
editor screenshot no WYSIWYG

Click on the little pencil-and-paper icon to get back into WYSIWIG mode for it to look like this:

editor screenshot WYSIWYG mode

And you should be good to go!

Get the SyntaxHighLighter Plugin

Plugin version:
2.0.1
Last Updated:
2010-01-02
Requires:
Mango Blog 1.3+
Auto-install URL:
http://mangoblog-extensions.googlecode.com/files/syntaxhighlighter_mango_plugin.zip
Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds