We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
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

 
Topic revision: r3 - 25 Jul 2008 - 22:44:24 - KennethLavrsen
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback