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? __________________________________________________________________ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \ Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: jsanford@atinucleus.com Web: http://www.atinucleus.com Source Code, No Royalties, Any CPU...It just make sense ! __________________________________________________________________
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
On Feb 21 2000 at 6:23 PM, Stephen Pitts wrote:
I've been using HTML comment syntax lately, because it lets me do stuff like:
<!-- <dtml-if foo> --> Hello <!-- </dtml-if> -->
Actually, this shouldn't work (the way you probably think it should). Zope's DTML parser does not respect HTML comments, so the <dtml-if> is still executed. As a simple example, try this: <!-- <dtml-if "0"> --> Not here! <!-- </dtml-if> --> The real advantage of using <dtml-comment> is that it is part of DTML, so the DTML parser recognizes it. It's just a pain to type out every time you want to comment something. Regards, Ben
participants (3)
-
Ben Glazer -
Jim Sanford -
Stephen Pitts