Pygments (http://pygments.org) is a very powerful, easy to use library that can help you with syntax highlighting on your blog or other documents. I am going to quickly show you 4 different ways you can use pygments to easily add syntax highlighting to your website. Pygments can be found in most package managers:
- Debian/Ubuntu: aptitude install python-pygments
- Gentoo: emerge pygments
- Darwin Ports: port install pygments
- Easy Install: easy_install Pygments
Command Line
pygmentize is the command line tool that the pygments library provides. Here is a quick reference for common use cases:
- Output HTML: pygmentize -f html -o ...