Many blogs seems to use alexgorbatchev’s scripts, but I found those a little sluggish in use. Code.google.com uses Google Code Prettify. It works great and simpler to install (plus has nice features like auto language detection).
You basically add the following js files to your blog’s custom HTML
And add onload=“prettyPrint()” to your document’s
<body> tag. Wrap your code in pre tags to colorize
(if you can’t store the files on your own server, use the hosted version at: http://google-code-prettify.googlecode.com/svn/trunk/src/)
Another cool option is to use the
:TOhtml function in Vim (if you use vim). This will create html with appropriate color tags. If you like CSS better, set
:let html_use_css = 1.
UPDATE: Nevermind, I switched to Github’s Gists instead. Much nicer.