I recently worked with PyJade's maintainer to resolve a bug I experienced 
when creating Jade templates for Django.

I haven't reviewed all of the Syrus's changes to his codebase, but PyJade 
should now allow all Django tags (including custom tags) when prefixed by 
"-".

For example:

- any_tag
  p Some text

For custom tags which must be autoclosed, such as {% trans "Some text" %}, 
PyJade now checks for settings.PYJADE:

PYJADE = {
'autocloseCode': ['custom_tag',]
}

I've CCed Syrus (PyJade's maintainer). I'm sure he'll reply if anything 
I've written is inaccurate, or if you have any further questions.

Hope this helps,
Aris


On Tuesday, May 29, 2012 7:25:18 PM UTC+3, Dustin Farris wrote:

> 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 <https://github.com/SyrusAkbary/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?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/eI7bsu5aya4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to