Skip to content
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

jinja2 templates are very hard to read #17

Open
aspiers opened this issue May 1, 2013 · 3 comments
Open

jinja2 templates are very hard to read #17

aspiers opened this issue May 1, 2013 · 3 comments

Comments

@aspiers
Copy link

aspiers commented May 1, 2013

e.g. github.text.jinja2 begins

{% if events %}
[github]
{% if commit_comment_events or issues_comment_events or  pull_request_review_comment_events %}
- 
{%- if commit_comment_events %} {{ commit_comment_events|length }} commits{% endif %}
{%- if issues_comment_events %}{% if commit_comment_events %} and{% endif %} {{ issues_comment_events|length }} issues{% endif %}
{%- if pull_request_review_comment_events %}{% if issues_comment_events or (commit_comment_events and not issues_comment_events) %} and{% endif %} {{ pull_request_review_comment_events|length }} pull request reviews{% endif %}
 commented
{% endif %}

OMGWTFBBQ :) Is there a good way to make these more legible?

@aspiers
Copy link
Author

aspiers commented May 1, 2013

@aspiers
Copy link
Author

aspiers commented May 1, 2013

I have pretty much solved this and will send a pull request.

@saschpe
Copy link
Owner

saschpe commented May 13, 2013

The tricky part here is the combination of the comment types that can occur. I wanted to keep the output on a single line, thus those endless if-cascades are there. So in this case I think it's not Jinja2's fault but mine. But I agree, it would have been more readable if I added some line-breaks ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants