Pygments.com Launched

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

5 Responses to “Pygments.com Launched”

  1. Anonymous Says:

    Excellent!!

  2. Johan Sundström Says:

    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.

  3. gavi Says:

    Those are good suggestions. I will see if i can do them this weekend.

  4. Anonymous Says:

    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

  5. gavi Says:

    Can you send us the example page you are using?

Leave a Reply