Opened 19 years ago
Closed 18 years ago
#1778 closed enhancement (fixed)
Proposed {% "alternate comment syntax" %}
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | |
Severity: | minor | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
What if, in addition to {% comment %}{% endcomment %}
, the template system offered this alternative syntax:
{% "Quoted standalone comment" %}
and/or
{% """Quoted standalone comment""" %}
It's much more concise, vaguely Pythonic in a docstring kind of way, and (I think) unambiguous with regard to current tags.
Change History (5)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
The {# #} syntax has already been proposed in #648, which was marked "wontfix".
comment:3 by , 19 years ago
Yeah, I wanted to propose something that adds as little visual clutter as possible. FWIW I expect the triple-quote variant to be frowned upon, since the templates are explicitly are designed for non-programmers, and triple-quoting doesn't make much sense to anybody else.
Regular quotes (single or double) would be enough.
I definitely understand the desire to keep the template engine lean.
We already have {% %} for tags, {{ }} for variables, I think comments are another totally different category, they would deserve an own syntax. Python comments start with # so I propose {# #} for template comments.