Tuesday, March 3, 2009

Syntax Highlighter

So I got an email this morning asking me about the code blocks in my posts.

Hey I noticed that your code you put in your posts has changed, can you tell me what your using to do that I really want it for my blog.

Basically I had received a number of emails stating that my code was impossible to copy and paste easily, so I started writing my own syntax highlighter and then I poked my eye out! Basically I realized that someone had already done this so why was I spending my time on it. And then I set out on my search through the search result jungle of Google.

After reviewing a ton of different methods I found one I liked the best Syntax Highlighter by Alex Gorbatchev. It’s actually very slick, it post processes the tags in your page and does the decoration after it loads via JavaScript. So I don’t have to worry about any real formatting and the like just wrap my code blocks in some simple tags and done.

Anyhow go check it out and donate to him he has done a lot of work and it is really quite good. 

No comments: