#14831: Django Template Style Guide
-------------------------------------+-------------------------------------
Reporter: Simon Meers | Owner: Ryan
| Cheley
Type: New feature | Status: assigned
Component: Documentation | Version: 1.2
Severity: Normal | Resolution:
Keywords: template, style, | Triage Stage: Accepted
format |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ryan Cheley):
After reviewing the html files this is what I've found:
False positives from the script above
* `./contrib/admindocs/templates/admin_doc/bookmarklets.html` has inline
javascript on line 22 which is the source of:
||= Count =||= Symbol =||
|| 2 || {al ||
|| 1 || {if ||
|| 1 || {re ||
|| 1 || {vi ||
|| 1 || {x= ||
* `./contrib/admindocs/templates/admin_doc/template_filter_index.html`
line 23 which is triggering the {"|. This seems to fall outside of the
requirements for this ticket
* `./contrib/admindocs/templates/admin_doc/template_tag_index.html` line
23 which is triggering the {"|. This seems to fall outside of the
requirements for this ticket
* `./forms/jinja2/django/forms/widgets/multiwidget.html` line ` has `{%-`.
Per the [https://jinja.palletsprojects.com/en/3.1.x/templates/#whitespace-
control jinja2 docs] this is in place for whitespace control
Files where the standard isn't being followed
* `./views/templates/technical_500.html` on line 157 has
`<td>{{server_time|date:"r"}}</td>`
Based on these findings it seems that the docs that are currently written
are being enforced.
Next steps:
- review `extends` and `load` tag placement
- placement of HTML in `block`
- indentation practices for code inside of `block`
--
Ticket URL: <https://code.djangoproject.com/ticket/14831#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018ce03efbba-420cae61-d9cf-4b12-b47c-3118680a0a57-000000%40eu-central-1.amazonses.com.