Feeds:
Posts
Comments

Archive for February, 2008

textile hacked, part 1

While writing my little django blog, I first encountered textile. So far so good. Very nice. But not perfect 🙂 So the first of my hacks was to implement a django template filter version of textile that supported head_offset.

If you want it too, simply change django/contrib/markup/templatetags/markup.py from

return mark_safe(force_unicode(textile.textile(smart_str(value), encoding='utf-8', output='utf-8')))

to

return mark_safe(force_unicode(textile.textile(smart_str(value), encoding='utf-8', output='utf-8', head_offset=settings.MARKUP_HEAD_OFFSET)))

Don’t forget to set something like MARKUP_HEAD_OFFSET = 2 in your settings.py.

voilĂ !

Advertisements

Read Full Post »