Opened 9 years ago

Closed 9 years ago

#1778 closed enhancement (fixed)

Proposed {% "alternate comment syntax" %}

Reported by: pb@… Owned by: adrian
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: UI/UX:


What if, in addition to {% comment %}{% endcomment %}, the template system offered this alternative syntax:

    {% "Quoted standalone comment" %}


    {% """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 Changed 9 years ago by Pistahh

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.

comment:2 Changed 9 years ago by ubernostrum

The {# #} syntax has already been proposed in #648, which was marked "wontfix".

comment:3 Changed 9 years ago by pb@…

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.

comment:4 Changed 9 years ago by Armin Ronacher <armin.ronacher@…>

Or like in jinja:

{* comment *}

comment:5 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [3931].

Note: See TracTickets for help on using tickets.
Back to Top