Thanks for chiming in Hampton:
I'm not sure we (the for-delimiter folks) are explaining ourselves very
well. First, I think we more or less agree that the best delimiter would be
the hat character "^". The {{_}} simply remained the title of the first
email, even though we agree it doesn't fit the bill.
The second question that you raised is much closer to our concerns (Duncan,
I hope I'm not overstepping by saying 'we').
>> unless you used Haml to *generate* some JS that was the proper template
you were looking for...
That's precisely what we are trying to do. Here's a quick example:
%h1 {{ MyJsVar.thatIsPlainText }}
On the client side, the haml would resolve to:
<h1>{{ MyJsVar.thatIsPlainText }}</h1>
This already works, and *haml does not need to change to handle this
case*...the
template is just plain text that gets rendered out. But something a little
more complex, like 'block' templates, would need some additions:
^if myVar > yourVar
%h1 {{ myVar }}
^else # I always forget whether we
should indent the 'else' in regular haml.
%h2 {{ yourVar }}
The above might resolve to the following in Handlebars:
{{#if myVar > yourVar }}
<h1> {{ myVar }} </h1>
{{#else}}
<h2> {{ yourVar }} </h2>
{{/if}}
And it would look like this with Ejs:
<% if( myVar > yourVar ) { %>
<h1> <%= myVar %> </h1>
<% } else { %>
<h2> <%= yourVar %> </h2>
<% } %>
The advantage is that people can keep the indentation, succinctness, and (I
would say) semantic meaning provided by haml, to write client-side
templates. I'll try and refrain myself from pestering you with this idea
any further...just wanted to make sure we are on the same page before you
decide it really doesn't fit. I'd be happy to answer any more questions
though.
Cheers,
Bernie
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/haml/-/eU9bCD2PaSQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.