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.
5
Comments
—
Comments feed for this post
#2 Eliot commented on 2009-06-04:
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.
#3 Felix commented on 2009-06-05:
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 :-)
#5 Nate commented on 2009-07-22:
Where exactly do I dump the css code on Blogger.com...?
:( Sorry I am confused.
Post a comment
About
I'm Eliot and this is my notepad for programming topics such as Python, Django, Ubuntu, Emacs, etc... more »
Search Blog
Tags
-
algorithms
(4)
-
aws
(8)
-
blogproject
(20)
-
c_cplusplus
(12)
-
cardstore
(8)
-
colinux
(2)
-
concurrency
(9)
-
conkeror
(2)
-
cygwin
(18)
-
datastructures
(15)
-
datetime
(3)
-
dell
(3)
-
django
(39)
-
emacs
(20)
-
files_directories
(10)
-
install_setup
(7)
-
javascript
(3)
-
keyboard
(6)
-
matplotlib
(5)
-
mercurial
(4)
-
nginx
(2)
-
preferences
(8)
-
processes
(3)
-
pyqt
(18)
-
python
(122)
-
ratpoison
(3)
-
regexes
(5)
-
rsync
(3)
-
softwaretools
(17)
-
sql
(13)
-
ssh
(7)
-
subversion
(6)
-
twisted
(6)
-
ubuntu
(60)
-
urxvt
(5)
-
vxworks
(25)
-
webservices
(4)
-
wmii
(7)
Blogroll
- Adam Gomaa
- Alex Clemesha
- Amir Salihefendic
- Armin Ronacher
- David Beazley
- David Ziegler
- Duncan McGreggor
- Gareth Rushgrave
- Glyph Lefkowitz
- Guido van Rossum
- Ian Bicking
- Jacob Kaplan-Moss
- James Bennett
- James Tauber
- Jesper Noehr
- Matt Harrison
- Nikolay Kolev
- Parand Darugar
- Peter Baumgartner
- Peter Bengtsson
- Rob Hudson
- Simon Willison
- Will McGugan
#1 Felix commented on 2009-06-04:
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 :)