Friday, September 28, 2007

Syntax Highlighting for Code Embedded in Blogger

There are multiple ways for highlighting the syntax of code embedded in Blogger. One way is to generate HTML files directly from VIM using :TOHtml and extract the CSS part in it and use it in Blogger. You can do the same with Textmate or Emacs. Another alternative is to use Prettifier. Prettifier is very easy to use. All you need to do is add a CSS and JavaScript file in your server and link them in your blog template. Please look at the readme file for more details. In my case, Blogger does not allow me to upload JavaScript files and CSS files, so I'm hosting them on a different server. I have updated my earlier posts to use Prettify.

The Perl code has turned out bit messy, but the GreaseMonkey JavaScript code looks clean.


xeozus said...

Bro, i think we can use prettifier code from it's original location of that files is placed. Yes, it's from google-code itself. Take a look this URL path:

We can use it already. BTW, thank's for the post.

wow power leveling said...

EVEN by wow gold the standards gold in wowd of the worst financial buy wow gold crisis for at least wow gold cheap a generation, the events of Sunday September 14th and the day before were extraordinary. The weekend began with hopes that a deal could be struck,maplestory mesos with or without government backing, to save Lehman Brothers, America''s fourth-largest investment bank.sell wow gold Early Monday buy maplestory mesos morning Lehman maplestory money filed for Chapter 11 bankruptcy protection. It has more than maplestory power leveling $613 billion of debt.Other vulnerable financial giants scrambled maple money to sell themselves or raise enough capital to stave off a similar fate. billig wow gold Merrill Lynch, the third-biggest investment bank, sold itself to Bank of America (BofA), an erstwhile Lehman suitor,wow power leveling in a $50 billion all-stock power leveling American International Group (AIG) brought forward a potentially life-saving overhaul and went maple story powerleveling cap-in-hand to the Federal Reserve. But its shares also slumped on Monday.