Twitter Updates

Tuesday 28 April 2009

Displaying code Snippets on blogspot

I have been trying to show pretty code snippets on blogspot.com/blogger.com. I found for larger files github.com displays code nicely but not very handy for short inline examples. Today I discovered prettify by google



This post describes setting up code.google prettify on blogger.com



Originally explained here:
http://lukabloga.blogspot.com



Include this before the head tag in the blogger template.



I have made a modified version of the css file suitable for displaying code on darkbackgrounds, I use this instead:





Then change the body tag to:



Then use the prettyprint class when using pre tags around code:



No comments: