A Simple Code Syntax Highlighter for WordPress
A few months ago I was looking for a code syntax highlighter and happened across Alex Gorbatchev’s javascript SyntaxHighlighter. It is a rather impressive project and is fast and feature rich. It is also incredibly simple to use. In other words, I highly recommend it!
With that found, my next search was for a good WordPress plugin that utilized SyntaxHighlighter. At the time of this search, there were a few options. However, none of them were very compelling and several had bugs. So, I sat down and put together a quick plugin that wrapped the SyntaxHighlighter functionality. This is how WP-SimpleSyntaxHighlighter was born.
So, what is WP-SimpleSyntaxHighlighter? Like the name suggests, it is just a simple SyntaxHighlighter for WordPress. Literally, all it does is insert the appropriate references to the SyntaxHighlighter javascript and CSS files. It also adds some basic configuration options to allow a user to decide what CSS theme should be applied and what code languages should be supported.
At the time of my original search, none of the other plugins allowed you to configure what syntax brushes were loaded. To me, this was a problem. SyntaxHighlighter supports a number of languages. Many of these I have little to no interest in. So, why would I want that extra code loaded for each and every page view on the blog?
Today, at least one other plugin supports this configuration feature. However, I thought someone might still find this plugin useful.
So, if you do find this useful, please let me know. Also, if you have any feature suggestions or find bugs, let me know.
Here is a quick C# example to show the plugin at work:
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}




