
After everyone gave me such great naming advice for Cassius and Julius, I've decided to be greedy and ask for some more help. The subject: comments in Hamlet. I've been asked a few times to add a feature where you can comment your templates, so I wanted to discuss it with the list. I'm really trying to avoid making any more special characters, so the first thing that comes to mind is to reuse an old character. My thought was to allow "$#" at the beginning of a line turn the whole line into a comment. What are people's thoughts on that? Also, Hamlet and Cassius almost certainly should have the comments, but I'm not sure about Julius. Since it's basically just raw Javascript, I think people should use Javascript comments, and then hopefully in the future we'll include Javascript compression in Hamlet that removes all comments. Michael

Are you meaning add an extra syntax to conveniently output "<!-- comment -->" or a comment that only exists in the hamlet template and not within the generated html output? The former seems less useful, on the rare occasion "<!-- comment -->" is required I will type it directly. This would seem like a waste of syntax if it didn't get used enough. For the latter though why can't you make regular double dash '--' as the comment to maintain consistency for when the hamlet is written quasi quoted within haskell source? (Currently it ends up in the generated html). Thanks Tim M

I'm talking about the latter: inserting comments that only exist in the
template and make no appearance in the generated HTML at all.
The reason to avoid the double dash is that it adds a brand new "special
string" to Hamlet. Frankly, I don't think a double dash is so uncommon--
it's often times used instead of an mdash, so I'd be very wary of doing
this.
Michael
On Thu, Aug 12, 2010 at 6:47 PM, Tim Matthews
Are you meaning add an extra syntax to conveniently output "<!-- comment -->" or a comment that only exists in the hamlet template and not within the generated html output?
The former seems less useful, on the rare occasion "<!-- comment -->" is required I will type it directly. This would seem like a waste of syntax if it didn't get used enough.
For the latter though why can't you make regular double dash '--' as the comment to maintain consistency for when the hamlet is written quasi quoted within haskell source? (Currently it ends up in the generated html).
Thanks
Tim M
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

On Fri, Aug 13, 2010 at 6:04 AM, Michael Snoyman
I'm talking about the latter: inserting comments that only exist in the template and make no appearance in the generated HTML at all.
The reason to avoid the double dash is that it adds a brand new "special string" to Hamlet. Frankly, I don't think a double dash is so uncommon-- it's often times used instead of an mdash, so I'd be very wary of doing this.
I was trying to wait for others opinion on this but can you please clarify on what you mean by "special string" and the issues around it. If it was me that was being unclear: I mean I can place "--" anywhere in my haskell source and the remainder of the line becomes a comment and will show in vim's syntax highlighter in a different color accordingly. If I were to place "--" in the quasi quoted hamlet template however, the syntax highlighter will show it in a different color because the haskell.vim file doesn't recognize the quasi quoter but in the generated html file the "--" and all the other text following actually appears. If quasi quotation was to be the primary way to use hamlet then I think "--" would give it that added level of consistency but in large scale projects it may be beneficial to have someone working on the hamlet files separately and therefore consistency doesn't really make much sense if quasi quoted became unpopular. Tim Matthews

On Sun, Aug 15, 2010 at 9:22 AM, Tim Matthews
On Fri, Aug 13, 2010 at 6:04 AM, Michael Snoyman
wrote: I'm talking about the latter: inserting comments that only exist in the template and make no appearance in the generated HTML at all.
The reason to avoid the double dash is that it adds a brand new "special string" to Hamlet. Frankly, I don't think a double dash is so uncommon-- it's often times used instead of an mdash, so I'd be very wary of doing this.
I was trying to wait for others opinion on this but can you please clarify on what you mean by "special string" and the issues around it. If it was me that was being unclear: I mean I can place "--" anywhere in my haskell source and the remainder of the line becomes a comment and will show in vim's syntax highlighter in a different color accordingly. If I were to place "--" in the quasi quoted hamlet template however, the syntax highlighter will show it in a different color because the haskell.vim file doesn't recognize the quasi quoter but in the generated html file the "--" and all the other text following actually appears. If quasi quotation was to be the primary way to use hamlet then I think "--" would give it that added level of consistency but in large scale projects it may be beneficial to have someone working on the hamlet files separately and therefore consistency doesn't really make much sense if quasi quoted became unpopular.
I'm not convinced that the consistency of comment styles outweighs the difficulty of having a new special character sequence in Hamlet; for now, Hamlet comments will remain $#. Thanks for the feedback, sorry I'm going the other way on it ;).
Michael
participants (2)
-
Michael Snoyman
-
Tim Matthews