[reportlab-users] New snippet posted: colourising code with Pygments

Marius Gedminas marius at gedmin.as
Thu Dec 17 10:34:32 EST 2009


On Thu, Dec 17, 2009 at 01:36:28PM +0000, Andy Robinson wrote:

> We wanted to make our manuals a bit prettier this week, and found it

> quite easy to use Pygments to colourise Python code with Platypus. An

> example is here, and support is now in the library...


Cool!


> http://www.reportlab.com/snippets/11/


Incidentally, how is this snippet server implemented? Would it be hard
to make it use human-friendly URLs like

http://www.reportlab.com/snippets/11/colourising-code-with-pygments

? Something simple: for canonical URL generation convert alphanumerics
of the snippet title to lowercase, replace other characters with dashes,
truncate to a sane limit (maybe 64 chars), append to snippet ID. For
serving requests, just ignore the human-friendly extra step in the URL
and use the '11' for identification.

I believe Amazon.com uses this scheme, and it's nice to know what you'll
get when you click on a URL just from seeing the URL without having to
consider context.

Marius Gedminas
--
Moore's Law, I need hardly remind a top-notch industry professional like you,
states that as the density of silicon circuitry doubles, the probability of you
not being able to find some sensibly-priced extra memory to fit your old lappy
approaches 1.0.
-- Verity Stob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091217/29364096/attachment-0001.pgp>


More information about the reportlab-users mailing list