[Zope] comments

Stephen Pitts smpitts@midsouth.rr.com
Mon, 21 Feb 2000 18:22:56 -0600


On Mon, Feb 21, 2000 at 04:11:09PM -0600, Jim Sanford wrote:
> I like to comment my code and I find myself wanting something a little more flexible than the <dtml-comment></dtml-comment>
> convention.
> 
> What I think would be nice would be a way to embed a comment into any dtml tag.
> 
> Here is my suggestion:
> 
> <dtml-var some_money_variable fmt='dollars-and-cents' // everything from  the double slash
> to the ending greater than bracket is a comment>
> 
> I program a lot of javascript and am acustomed the // for comments, but any kind of simple trigger is fine by me.
> 
> Feedback?

I agree...<dtml-comment> has some problems, especially in this
situation:
<dtml-if foo>
Hello
</dtml-if>

You can't comment out the parts of the if like this:
<dtml-comment><dtml-if foo></dtml-comment>
Hello
<dtml-comment></dtml-if><dtml-comment>

because Zope evidently uses some type of strict XML-parsing thing on the
code. IMHO, <dtml-comment> should be mothballed in favor of something
easier to type that isn't a tag. I've been using HTML comment syntax
lately, because it lets me do stuff like:

<!-- <dtml-if foo> -->
Hello
<!-- </dtml-if> -->

	or 

<dtml-call "REQUEST.set('pi', 3.14"><!--only accurate to two digits-->
-- 
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org