How to get syntax highlighting in Blogger with Pygments



This is my OLD blog. I've copied this post over to my NEW blog at:

http://www.saltycrane.com/blog/2007/12/how-to-get-syntax-highlighting-in/

You should be redirected in 2 seconds.



  • $ sudo easy_install Pygments
  • $ pygmentize -f html myscript.py
  • copy html code to blog post
  • $ pygmentize -S default -f html
  • copy css to Blogger template

The Pygments website is located at: http://pygments.org

Update 5/21/2008: Andrew K. emailed me about a javascript syntax highlighter called highlight.js at http://softwaremaniacs.org/soft/highlight/en/. I have not tried it, but it looks pretty cool.

No comments:

About

This is my *OLD* blog. I've copied all of my posts and comments over to my NEW blog at:

http://www.saltycrane.com/blog/.

Please go there for my updated posts. I will leave this blog up for a short time, but eventually plan to delete it. Thanks for reading.