How to get syntax highlighting in Blogger with Pygments
$ 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.
Comments
Hey wow, so I wasn't the first one to think of that! :P
Anyway, I coded a little web app to help people use Pygments on their blog, you can check it out in my "website". I also wrote a blog post about making it, link is in the about section of the site, if you're interested. I would really like your opinion on the app :)
Felix, that's great you built a Pygments web app. I tried to get to your site (http://pygmentool.mine.nu/) but I got a Network Timeout.
Ah, sorry about that. It seems my mother vacuumed around and unplugged my server :. Anyway, it's back up now and you should be able to use it :-)
heh, that's classic. =)
your tool works well. nice job!
Where exactly do I dump the css code on Blogger.com...?
:( Sorry I am confused.
Hi,
Thanks - works great !