Replies: 4 comments
-
I like jinja2, use it a lot with e.g. Ansible. The whitespace issue mostly crop up in e-mail templates for me, in HTML whitespace is less of an issue (unless you want the source to look nice, and who do not want that). Converting Hypha to jinja2 will most likely not happen. We can add more value to the users by working on new features and bug fixes I believe. If someone was willing to commit the needed time to get it done… |
Beta Was this translation helpful? Give feedback.
-
This makes sense! What I'm hearing is that while y'all wouldn't necessarily be opposed, it's a large enough effort + low enough priority that it won't be taken on. Totally understandable! Would you like me to close the issue or leave it open in case someone cares enough to make the fix (for context -- we might care enough since our clients want plaintext emails and our current templates are pretty rough right now because of the limitations) |
Beta Was this translation helpful? Give feedback.
-
As you say, not opposed. Our team will most likely not have time to take it on, if yours might then please leave the issue open. |
Beta Was this translation helpful? Give feedback.
-
Great -- I'll leave it open for now and check with the OTS team to see their thoughts. |
Beta Was this translation helpful? Give feedback.
-
I'm working on some template modifications for my local instance of Hypha and I'm facing some pain points with the Django template engine, particularly related to whitespace. Django supports use of jinja2 to drive its templating, and I believe jinja2 is a more feature rich template solution than the one Django provides.
Would there be any openness to considering switching to jinja2 as the default templating system in Hypha?
For context: Apparently 8 years ago the Django team basically said they don't want to support their template system / want to move to something like jinja as the default.
An Example of a Limitation
It might be helpful to have the concrete example that inspired the question / idea. We want to send our emails as plain text rather than HTML (or, eventually, in addition to HTML). Unlike jinja, the Django templating engine has no support for managing whitespace in between control commands because it is designed explicitly around the HTML use case, rather than plain text.
For instance, we want:
to render
but instead it renders
We can get what we need from a user experience perspective using Django, but the template will be unwieldy:
In jinja we could do:
Beta Was this translation helpful? Give feedback.
All reactions