Google's Code Prettifier

Well, this is kinda cool :-). Google has released the Code Prettifier - a little bit of javascript and css to turn unformatted code into something nice:

For example

void Main()
{
Console.WriteLine("Hello Blog!!");
}


Can become

void Main()
{
Console.WriteLine("Hello Blog!!");
}

With just the following tags around the code <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code>

Thanks Google!

P.S. Looks like I need to work on the colour schemes. Ah well, nothing's perfect I suppose.

P.P.S It doesn't appear to handle <br /> tags properly at the moment which causes problems in blogger posts.

 

Reader Comments

Post a Comment



Welcome

Thanks for dropping by. Enjoy your visit!

MVP Logo
Find out more about Richard.

Richard on Twitter  
profile for Richard Banks on Stack Exchange, a network of free, community-driven Q&A sites

User Groups

My Open Source Projects

Podcast

Blog Archive