[Templates] Re: PROPOSAL: Add COMMENT BLOCK directive.
Dave Howorth
dhoworth@mrc-lmb.cam.ac.uk
Thu, 14 Jun 2007 16:12:48 +0100
Harald Joerg wrote:
> Robert Hicks <sigzero@gmail.com> writes:
>
>> Paul Seamons wrote:
>>> Text::Tmpl has a COMMENT directive. Both to
>>> enhance cross compatibility as well as to add features, it
>>> would be nice for TT to support this directive. It would
>>> most likely have to be added at the TT3 release.
>>>
>>> Template::Parser::CET and Template::Alloy support it currently.
>>>
>>> [% COMMENT %]
>>>
>>> Template section that won't be shown
>>> [% var_a %]
>>> [% IF foo %]Foo[% END %]
>>>
>>> [% END %]
>>>
>>> Paul Seamons
>> Do you mean this to be something analogous to Javadoc? Otherwise there
>> is already a way to comment stuff with [%# %]. What do you mean by
>> "cross compatibility"?
>>
>> [%#
>> Template section that won't be shown
>> [% var_a %]
>> [% IF foo %]Foo[% END %]
>> %]
>
> No, that won't do: The comment '[%#' ends with the *first* '%]' it
> encounters, there's no concept of nested tags (at least in TT2).
[% TAGS <+ +> %]<+#
whatever is commented out
#+><+ TAGS [% %] -+>
> So a comment block would add something I could have used sometimes in
> the past.
It would certainly be prettier :)
Cheers, Dave