Friday 18 March 2011

Source code formating in blogspot

I am putting together a Windows Phone 7 tutorial ... and then I came across the issue of how to include code in the blog posts. Here is the solution.

First get the code nicely formatted - the following tools may help
http://jsbeautifier.org/
http://www.prettyprinter.de/

Then include the prettyprint function into your Blogspot template. The following Link show how:
http://lukabloga.blogspot.com/2008/10/to-test-new-highlighting.html

You have alter the template you can use the following command to include code in the HTML code with the pre-tag and the class=prettyprint.

Alternatively you can convert source code into HTML:
http://www.tohtml.com:
http://www.neathighlighter.com/

more links at
http://techbrij.com/3/code-syntax-highlighting-for-a-free-hosted-blogger-blog