Skip to main content


Showing posts from September, 2011

Insert code snippets in Blogger using Prettyfy

If you want to insert code snippets with syntax-highlighting in your blogs on, then you can use google-code-prettify.
There are other syntax highlighting solutions out there, but this allows to do this very simply.
The steps are:
Click on "Theme" (in LHS of blogger home page) or "Design" (in upper RHS corner).Click on "Edit HTML" button.Search for <head> tag in the html.Insert following line after meta tags in head tag:
<script src=';lang=yaml&amp;lang=bash&amp;lang=xml&amp;lang=sql&amp;skin=sons-of-obsidian' type='text/javascript'></script> For me it is just before <title> tag.
Add onload property to <body> tag:
<body class='container' onload='prettyPrint()'> Here I have used "Sons-Of-Obsidian" style, you can use any of the available themes.Save the template.Now, …