I purchased Pygments.com domain yesterday. Iam surprised the domain is still available. i guess the Pygments guys dont really care about the .com domain name.
Any way access it via http://www.pygments.com
You can use the code colorizer by going to the
Colorizer Test Program.
But the cool thing i added is, a javascript service to colorize any code.
Lets say you have a webpage with code, that needs colorizing, Just add this Javascript to the end of the page (Before you close the body tag)
<script src=”http://www.pygments.com/js/init.js” type=”text/javascript”></script>
All you will need to do is define your code in <pre> tags with unique ids that include some information about the type of the language.
For example:
<pre id=”python_1″>
print “Hello World”
</pre>
It will automatically colorize the page by making JSON type requests to pygments.com with the code in the page.
So the above would come out like this
print "Hello World"
BTW: pygments javascript is enabled on this site
Related posts:
- Line numbers and other cool stuff Added to Pygments.com I added line numbers and some formatting capabilities to Pygments.com...
- Pygments! Pygments is a cool code colorizer. Its written in python...
- Pygments Test Program Test Pygments here. http://colorize.objectgraph.com/ Its running on our new server...
- bug in FireFox? Look at the following code. <html> <head><title>Bug in Mozilla?</title></head> <script...
- JSON – Serialized Language and Cross-Domain Scripting JSON Installation Description Service / Client Test in PHP...
Related posts brought to you by Yet Another Related Posts Plugin.






















5 Responses
Excellent!!
Rather cool. Would you consider doing some minor tweaks, and have its underlying JSON(P) a stable end point for direct use, too?
Re: the minor tweaking, it would be useful if it allowed a callback= query parameter (substituting the leading “setPigment”), and an option of skipping your leading and trailing div/pre tag encapsulation.
Additional features that wouldn’t hurt: treating a lack of the query parameters id=, css= and linenos=, as the empty value.
Those are good suggestions. I will see if i can do them this weekend.
Hi I try to use this tool for python but I have found that > and < (or > or <) are displayed wrong in my source code (as the html versions > and < which renders my source code not that readable). Would be nice if you could change that. Thanks DR0ID
Can you send us the example page you are using?