About Archive Tag Cloud Translations RSS

You are writing a comment about A Syntax Coloring Template Filter for Django, here is a quick summary:

I spent a bit of time this evening writing a template filter for Django that accepts a string of code (and optionally the name of the Pygments lexer to use for highlighting) and returns the code nicely syntax colored. A simple but slightly helpful addition to your templating arsenal.


You are responding to this comment written by Jonas on August 14th 2008, 17:30.

Very nice. FYI for you. In my test, the code highlighting is correct, but the code block area highlighting only fully covers the table version with class="highlighttable". The non-table version has highlight classes but does not entirely highlight the code area. Also I did not find the css class entry for highlighttable anywhere. It appears that the table is capturing the highlight color correctly but somehow the code text otherwise escapes the highlight box when not enclosed in a table. I'm using Firefox 3.01 on Ubuntu Hardy Fluxbox window manager.


Please be aware that comment forms go stale after one hour.





Comments may make use of LifeFlow MarkDown. Raw html will be escaped.


Quick Introduction to LifeFlow MarkDown Syntax

A highlighted code block:

@@ ruby
def a (b, c):
  b * c
end
@@

Other common languages work as well: scheme, python, java, html, etc.

Other markdown syntax:

 ### This is an h3 title
#### This is an h4 title
**this is bold**
*this is italics*

1. This is an
2. ordered list

* And an unordered
* list too

[this is a link](http://www.lethain.com/ "Lethain")