Context-aware Loaders

58 views
Skip to first unread message

Dustin Farris

unread,
May 29, 2012, 12:25:18 PM5/29/12
to django-d...@googlegroups.com
I don't think this is possible yet, but seems like a handy idea, and I'm not the first person to think so.

My use case deals with PyJade.  Right now, the library wraps the default loaders (similar to the way the django cache loader does) with a Django-specific loader and "pre-renders" the Jade template (which itself can produce Django syntax), then passes it along to the usual suspects.  The problem occurs when you try to add Django syntax within the Jade template.  PyJade provides a few "tags" that convert into Django syntax, but it is far from comprehensive, and really feels like he is reinventing the wheel.

With a context/request-aware loader, the PyJade loader could make an initial pass over the template, rendering down Django syntax into plain-text, and then continue processing the Jade syntax before passing it on.

Thoughts?
Reply all
Reply to author
Forward
0 new messages