Feature Proposal: Create TWiki code commenting syntax
Motivation
As TWiki code for applications gets increasingly complex, it would be very helpful to be able to add explanatory comments within the code. Currently there is no available option for doing this. The closest viable option is using html comment syntax, but this results with the comment being included in the rendered page. Of course, it's invisible to users but still isn't an optimal solution.
Description and Documentation
What I'd like to propose is this:
- Allow the comment syntax that is currently implemented for template topic (e.g.
%{This is a comment}% ) to be used in regular topics.
- Strip the comments out before processing any other tags. This would allow us to insert comments anywhere within TWiki code without having to worry about conflicting with other code.
Being as this comment syntax is unlike any other code, I can't see that it would create any conflicts.
Examples
Impact
Implementation
--
Contributors: LynnwoodBrown - 25 Jul 2008
Discussion
Note that this makes conditional tags easier. For example,
%%BLAH%{param}%
If BLAH is set to a tag name, it is evaluated, otherwise it treats the parameters as a comment. This is in contrast to the approach currently required:
%%IF{'$BLAH' then="%BLAH%" else="NOP"}%{param}%
which is rather clunky.
--
CrawfordCurrie - 25 Jul 2008
Cool idea.
--
KennethLavrsen - 25 Jul 2008