Saturday, August 01, 2009

Ever wondered how one can embed code in blogs and web pages with language specific highlighting? Let's hit ground directly. It is a cakewalk by using js based open source Syntax Highlighter developed by Alex Gorbatchev.

Here We'll talk about embedding code with language specific syntax highlighting in blogger/blogspot. But it is pretty straight forward to do the same in any web page.

Setup Syntax Highlighter for Blogger

Open template layout for editing in 'Edit Html' mode.

Add following lines of code in head section (just before closing head tag </head>)