-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixin Blocks not supported in Django #285
Comments
Like i said before:
pyjade kinda seems abandoned :/ |
@kakulukia Thanks for your response. Pardon my ignorance, but you suggesting there is already a fix for this issue in discussion? |
Oh i misunderstood your post before and thought you were the author of that mentioned ticket since you were answering me. Forget about that. :) Though im a big fan of pypugjs and pyjade before that, i cant say the same about that codebase. I cant even make an educated judgement about it since i never wrote a parser, but it looks very complicated, so i only touched it where i felt it was necessary. |
@kakulukia I have difficulty imagining how someone would go about using pug without employing mixins at all. They are such a powerful feature, which can literally eliminate so much boilerplate. Particularly |
Okay, thanx for the clarification. |
@kakulukia Back to topic: |
Well, i fear there is no quick fix. But if you feel comfortable looking at the parser, please do! But like i said above, i didnt write it nor can i tell you where to start because i constantly think im missing out on the core concept of how the parse is designed to work. It looks complicated (or im thinking complicated) and i currently dont have enough time to investigate. But since mixins do work in pypugjs, the blocks shouldnt be that hard to implement. |
Please remove any mentions of pyjade and reopen this ticket at pypugjs instead as pyjade will just confuse people and let them send their pull request here, where it probably wont be merged. |
@kakulukia |
It appears using |
@pykong could you explain how you fixed this issue? what do you mean by "using |
One of the most powerful features of pug is the easy adding of content to mixins via blocks.
Unfortunately this feature does not work with Django as of the current stable release of pyjade/pypugjs.
See:
pyjade/pyjade/ext/django/compiler.py
Line 37 in d8cf1d9
Is there maybe any workaround to this limitation?
e.g. I tried to specify Jinja2 as an alternative template engine for Django, with pyjade as extension.
But I could not get it to render any pug code.
In lieu of a PR to add the feature to pyjade in the first place:
If there is any such workaround to get pyjade/pypugjs to support mixin blocks in Django such would be very helpful to be added to the docs.
@kakulukia
I summon you here, as you maintain a major fork of pyjade and hence have something to add.
Also, in response to your question in #224. Yes, I am a heavy user of mixins, as it allows to DRY-out much boilerplate code.
The text was updated successfully, but these errors were encountered: