If you are a programming blogger and you need to post code on your blog, you will definitely find this code highlighter tool handy. Thanks to Fabio Gomes , now this blog's code snippets have been upgraded with syntax highlights, and it's now more pleasing to the eyes.
Here are the steps in order to install the Python language support, you can easily add other languages by finding the corresponding tag mapping here :
- Go to your Blogger template , add the following code after the <!-- end outer-wrapper --> tag:
- Add the tag to surround your code snippet:
<pre name="code" class="py"></pre>
And it should work, just like below:
As pointed out by Ronald, the previous solution doesn't work because Google code doesn't render css/text properly in Firefox. So I have decided to host the css file elsewhere( and resulted in much lengther url!). The above code snippet has been updated with the latest css hosting. Hopefully Firefox team will fix this problem!
Note: Code Syntax Highlighter 2.0 is already available. For instruction on how to use it, refer here and here.