#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):

 I ran the following bash command (which is returning some false positives,
 for example `{al` is finding an inline javascrpt alert) to get a sense of
 what is current in the `django/django` directory

 {{{
 find django/django -type f -name "*.html" -exec grep -E
 "(\{\{[^}]*\}\})|(\{%[^%]*%\})" {} + | grep -o -E "\{.." | sort | uniq -c
 }}}

 This gives the following usages

 {{

 ||= Count =||= Symbol =||
 ||724 || {{ ||
 || 2 || {"| ||
 || 2 || {al ||
 || 1 || {if ||
 || 1 || {re ||
 || 1 || {vi ||
 || 1 || {x= ||
 || 1 || {{s ||

 {%

 ||= Count =||= Symbol =||
 || 2121 || {% ||
 || 1 || {%- ||

 For the items that don't conform to `{{` or `{%` I'll look more deeply at
 the occurrences and provide more context for them, but on initial review
 it seems that the preference / standard seems to be `{{` or `{%` followed
 by a space

-- 
Ticket URL: <https://code.djangoproject.com/ticket/14831#comment:10>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018cdfca14dd-d1eca040-15fb-43dc-b1ad-6d7ea9607462-000000%40eu-central-1.amazonses.com.

Reply via email to