djangosnippets.org: Latest snippets tagged with 'code'http://djangosnippets.org/tags/code/2008-06-24T10:23:21.299635-05:00Pygmentation
2008-06-24T10:23:21.299635-05:00alcideshttp://djangosnippets.org/snippets/822/<p>Usage: (if you save it as pigmentation.py as I did)</p>
<p>{% load pigmentation %}
{% autoescape off %}
{{ somevariable|pygmentize }}
{% endautoescape %}</p>
<p>There already a few of this code around, but this one is pretty clean, and includes css. It also works in both the development server and …</p>
Freely redistributablePygments Rendering Template Filter
2007-02-26T16:49:11.969531-06:00ericflohttp://djangosnippets.org/snippets/25/<p>Finds all <code><code></code></code> blocks in a text block and replaces it with pygments-highlighted html semantics. It tries to guess the format of the input, and it falls back to Python highlighting if it can't decide. This is useful for highlighting code snippets on a blog, for instance.</p>
Freely redistributable