Xylo is a lightweight syntax highlighter plugin that I have written to meet my specific requirements.
Almost since the start of this site in March 2009, I used SyntaxHighlighter Evolved as my syntax highlighting plugin of choice. To date it works well – it is feature rich and is lightweight.
Unfortunately I hit a roadblock with the plugin – v2 of the plugin uses Flash but is perfect for styling, and v3 doesn’t use Flash but cannot wrap lines. Talk of the devil and the deep sea! The first choice kept warning me that I shouldn’t be using SWF, and the second kept showing up on Google WebMaster with a mobile usability issue.
So I began my hunt for a suitable replacement, and this proved to be surprisingly difficult! I tried quite a few plugins, but wasn’t satisfied. I set myself these criteria for zeroing in on the plugin:
- I had announced a shift from jQuery, so I didn’t want to tie myself to a plugin that uses it. This ruled out Enlighter, which doesn’t use jQuery but uses MooTools.
- I was looking for something that wouldn’t add a massive file to my site’s source code. This, unfortunately, makes most plugins difficult to choose.
- I was looking for something that wouldn’t have me manually change all posts and pages that use the markup required by SyntaxHighlighter Evolved.
I eventually found a retired Google Code project: Code Prettify that meets the first two requirements. I then coded up something by borrowing from SyntaxHighlighter Evolved’s code, and generating markup that gets rendered using Prettify.
And thus Xylo was born – simple, lightweight, and perfectly suited for my requirements!