Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

WordPress Plugin for Ruby Syntax Highlighting

By Peter Cooper / January 19, 2007

Syntaxhighlighter
SyntaxHighlighter is a WordPress plugin that provides code presentation and syntax highlighting features for your blog (if it's WordPress powered, naturally!). It supports a plethora of languages such as C, C++, C#, HTML, and PHP, as well as Ruby. On my blogs so far I've tended to use a homebrew approach with the Syntax gem, but this WordPress plugin should make it a whole lot easier in the future. If you're a WordPress powered blogger who likes to post code snippets, check it out.

Comments

  1. Peter Cooper says:

    Sorry in advance that I've used a PHP example for the screenshot ;-)

  2. Sam. says:

    Great ! I made a test, but I've trouble with indentation : the editor remove them each time I save ! :(

    Except that problem, the result is clear and pretty, and there are many languages supported.

  3. Juixe says:

    I've been using this plugin for Ruby, Java, and CSS examples for some time and I totally love it. In CSS mode I saw one error when I would write 'right' and it would produce 'rightright'. Other than this, I recommend this plugin. If you want to see it in action, check out this intro tutorial on reopening ruby classes here...

  4. Tom Davies says:

    Sam: The problem you are having is due to the TinyMCE editor. You should disable it in your WP Options to fix it. I have found the TinyMCE editor to insert random garbage tags anyways so you probably won't miss it.

    Tom

  5. Chris Johnston says:

    Nice plugin, except it doesn't work, for me at least. I use WordPress with the Textile plugin and it seems that the two don't play well together. The problem that I am seeing is that Textile tries to format the text with the result being that I get strange html tags inserted into my code. Although they are oddly highlighted.

    Anyone else use SyntaxHighlighter and Textile together and experience this problem?

Other Posts to Enjoy

Twitter Mentions