Official ObjectGraph Blog

Archive for the ‘pygments.com’ Category

Line numbers and other cool stuff Added to Pygments.com

Sunday, January 14th, 2007

I added line numbers and some formatting capabilities to Pygments.com

Now the script tag renders line numbers by default. Also RTF download of colored code is available on the Test Page for those nice looking word documents

Check it out @ http://www.pygments.com

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