Sunday, 4th May, 2008

Syntax highlighter for python

Category: Python

Pygments is a python syntax highlighter library in python, which converts a raw code into colored highlighted syntax. I use this library for syntax highlighting for the posts on this blog. The library is very easy to use. Documentation and downloads are at Pygments home page.
The website also has Demo page which demonstrate the power of pygments library for highlighting syntax in several languages.
The following xml code is highlighted using pygments:
<addressbook>
<contact>
<name>Amaltas</name>
<phone>12345678</phone>
<address>123 abc street</address>

<email>amaltas@amaltas.org</email>
</contact>
<contact>
<name>Annie</name>
<phone>87654321</phone>
<address>890 xyz street</address>

<email></email>
</contact>
</addressbook>

Posted by Amaltas Bohra at 5:42 a.m.

0 comments »

Have your say

Name

Spam is a pain. If you are posting comment on this site for the first time, we will send you an email to activate the comment. Once you activate the comment, you can post comments without activation. This is one time activity.

Email (not published)

Blog/Website URL

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>