views:

64

answers:

2

How can I comment out parts of a Spark view so they aren't rendered to the client?

In aspx pages I can do this:

<%-- server-side comment --%>

I had thought using three dashes would work:

<!--- server-side comment --->

but it doesn't work and I now can't find the resource where I read that.

A: 

It's kinda funny, I couldn't find either. I looked into the source code of spark, in the parsing area. I found the code grammar parse which is I assume applicable to code blocks. In there you should be able to use //. Then in the markup grammar, the only mention of commenting is the standard HTML commenting (<!-- -->).

flq
+1  A: 

I use

# /* 
   Comment
   Goes
   Here
# */

(EDIT) Better yet, just use ASPX style tags:

<title> Hello World <% /* comment 
        goes here */ %> </title>

And, of course, HTML comments always work, too, if you don't mind seeing the commented text in your source.

tylerl