Tags:
create new tag
, view all tags

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

WhatDoesItAffect: Rendering

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

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-07-25 - KennethLavrsen
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.