Syntax highlighters
As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev’s SyntaxHighlighter. It turned out that there were in fact several WordPress plugins using Alex’s highlighter. Many of the existing highlighters did not work very well, they simply included the JavaScript file, requiring users to insert
<pre name="code" class="html"> ... </pre>
into the HTML. The problem is that WordPress’ HTML editor strips out the name=”code” part, rendering the plugins useless.
What I settled on using, for the time being at least, is Vijesh Mehta Syntax Highlighter Wordpress Plugin. The plugin still requires manual HTML editing, but avoids the stripping of the name attribute by using class=”brush:language_name” instead.
So, as a start for my posts on programming: the classical “hello world”, in ruby this time.
puts "hello world!"
Tags: code, plugins