Opened 18 years ago

Closed 18 years ago

#1778 closed enhancement (fixed)

Proposed {% "alternate comment syntax" %}

Reported by: pb@… 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 Pistahh, 18 years ago

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 by James Bennett, 18 years ago

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

comment:3 by pb@…, 18 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.

comment:4 by Armin Ronacher <armin.ronacher@…>, 18 years ago

Or like in jinja:

{* comment *}

comment:5 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

Fixed in [3931].

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