Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Deleted User

Looking for a lightweight code highlighter for my blog

Hi folks,

I'm looking for a lightweight code highlighter for my blog. If you have any suggestions or personal preferences let me know what you use! :)

Just to offer a little more information..

  • I use wordpress, if it's a plugin then awesome!
  • I have used gist.github in the past, which works ok-ish, but I have formatting issues at the moment, plus I want my code on my site, in my posts, not elsewhere.
  • It will only ever be used for the following: PHP, XML, bash commands

Also, if it's responsive that would be amazing. Since there will be less work for me to do ;)

I have of coursed searched google, but coming up shorthanded. Gist.github still seems to be the favourite that matches most my requirements.

Thanks!

3 Answers

James Barnett
James Barnett
39,199 Points

For my site I use highlight.js's rainbow theme.

Here's an example

  • It's extremely easy to use
  • It auto-detects over 50 languages
  • Has 2 dozen themes to choose from
  • It's also extremely easy to tweak

Apparently it has been packaged as a plugin

There are also quite a few other plugins

Matt West
Matt West
14,545 Points

Check out CodeRay or CodeMirror. I've used both in the past.

Note: CodeMirror was primarily built as an in-browser code editor but you can just use it's highlighting capabilities if you wish.

Deleted User

Cheers for the suggestions so far they look great! Highlight.js is my running favourite.

For the time being I'm going with SyntaxHighlighter Evolved but due to highlight.js having loads more brushes available that I hadn't considered I might need, I'll probably switch to that.

Awesome stuff :)