News

Changing Code Syntax Highlighters

Most of the posts I author here contain code examples. To highlight these code examples I’ve been using the wordpress plugin SyntaxHighlighter Evolved. For the most part this plugin has served me, and I hope you, well. There are a few quirks, however, that continue to annoy me about this plugin. Chief among those quirks is the need to “minify” its Javascript and CSS following each update to maintain rendering performance. That and its lingering use of the Adobe Flash file format SWF for its copy-to-clipboard feature, even though that feature was deprecated.

So I’m making a change. I’m dropping SyntaxHighlighter Evolved for Crayon Syntax Highlighter, a nice syntax highlighter built in PHP and jQuery. It’s intuitive to administer and provides some welcome relief from those aforementioned annoyances. More importantly though it offers you some nice features. For example mousing over the highlighted code results in a drop-down box where you can toggle line numbers on/off (they’ll be on by default), toggle line wrapping on/off (longer lines will wrap by default), view plain code, copy the code, or view the code in a separate browser window. You can try these features yourself in the following example:

In the next week or so I’ll begin transitioning older posts containing code examples over to this new plugin, and of course new post will use this plugin by default. Enjoy, and please let me know if you encounter any problems.

Leave a Reply

Your email address will not be published. Required fields are marked *