So I was playing around with the rather nice SyntaxHighlighter WordPress plugin. It worked pretty nicely. But it had some issues, IMO:
- It repurposes the
classattribute to act like a pseudo-CSS ruleset with custom rules. To me that’s just ugly. - It does all its work client-side. For some things that’s a nice touch, but for a blog with mostly static content it’s wasted time.
- It does almost everything in JavaScript. I have a personal distaste of working with JavaScript for no especial reason whatosever.
- It’s LGPLv3. I prefer less restrictive licenses for OSS.
On the other hand, I know the Pygments syntax highlighter pretty well, and I already had a written style plugin for it to get the syntax coloring I like. But there’s no mature Pygments plugin for WordPress that I could find. So I did what any good programmer would do and set out to write my own. I have the working knowledge of PHP (I’m a core dev, for mercy’s sake) and Python to do it with, after all. Not so much WordPress’ plugin API, though, so I took the SyntaxHighlighter plugin as a starting point.
Continue reading