新鲜、有趣,互联生活。令狐葱。

2010/02/01

How to highlight code in Bloggspot

We can implement code highlighting by changing blogger template, with the perfect opensource highlight tool: syntaxhighlighter.
1. Add the following code before "head" tag.









Note: you need to paste the CSS file to the template file manually.
http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css
2. Add the following code before "body" tag.



3. Now you can use it like:



You can also use "pre" tag to replace the "textarea".
Also you can collapse the codes if they are to long to display.


... some code here ...



This idea was from abhisanoujam, thanks.