Official ObjectGraph Blog

Archive for the ‘json’ Category

Pygments.com Launched

Saturday, January 13th, 2007

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