On Thu, 2007-05-17 at 17:12 +0000, Milan Andric wrote:
> Hello,
> 
> I'm using markdown as an output filter in my templates.
> 
> I'd like to extend it somehow so that it can parse a ![][123] image
> reference but the reference number will be a file object id or a
> inline reference, etc.  So then the object would get rendered
> appropriately and dynamically from the db.
> 
> So how would i extend the markdown filter?
> 
> Would this be better handled in another place, better way or different
> module?

Have a look at the source of the markdown filter
(django/contrib/markup/templatetags/). It's a trivial wrapper around the
markdown module. So you are really looking at extending the markdown
module's functionality. This is possible (there are hooks in markdown,
from memory, and the source is pretty well documented), so you might
want to look there.

As to how to ensure your markdown extensions are used by the markdown
filter, that may or may not be easy. I don't know; I've never tried it.
However, given how trivial the markdown filter is, if you need to change
anything on the Django side, just copy the half dozen lines to your
project and make your own filter and modify it at will.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to