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

Andy Robinson andy at reportlab.com
Thu Dec 17 10:48:51 EST 2009


2009/12/17 Marius Gedminas <marius at gedmin.as>:

> 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

>

It's standard Django so what you suggest is technically trivial.

'Friendly URLs' are OK in principle as long as the original author
chooses a good name, and does not change it. These things are highly
likely to get linked to.

The other concern is to keep it short. I prefer URLs which can be
read OK after being indented 2-3 times in email discussions. We're
up to 37 chars already with a two-digit code and I am not sure if,
say, a 30-char limit would be enough.

We looked at several systems.
- ActiveState Python cookbook uses numbers only
- Djangosnippets uses numbers only
- Stackoverflow uses what you suggest..


> For

> serving requests, just ignore the human-friendly extra step in the URL

> and use the '11' for identification.


If someone browsed to /snippets/11/, should the browser redirect them
to /snippets/11/colourised-python/code/ , or the other way round?

- Andy


More information about the reportlab-users mailing list