On Jan 27, 11:10 am, Neil Funk <[email protected]> wrote: > >there are Haml implementations for [...] even Erlang > > No way! Cool! Now all we need is one for Scheme, although those > folks will probably say that s-exps are all you'd ever need. ;)
Indeed. :) > Since HAML's got cross-platform/-language covered, it sounds like > sphaml's niche is in minimalism and extra-terse syntax. Well, the other thing about shpaml is that it is intended to sit on the top of the templating language, not replace it. > So, back to > that point, with the email I didn't get around to sending yesterday: > > (Good counter-points, Steve.) The only thing that really stumps me > about the pipe syntax is how to notate an empty tag. For a little > less contrived example, let's say I'm printing out rows from a > database: > > table > <% foreach row in table: %> > tr > td | <%=row.required%> > td | <%=row.optional%> > <% end %> > > What happens when row.optional==""? Don't you get: > table > tr > td | req1 > td | > tr > td | req2 > td | opt2 > Because I still sit on top of Django, I render the Django equivalent of your first snippet to Django, and then Django deals with the dynamic data being blank. > > > The main rationale for [no scripting language sugar] is simplicity and > > versatility, so that it can work with other templating languages. > > Could the previously-mentioned HAML way of escaping code (-,=) be > exposed in a language-independent way? I think it could, but my take on folks in the Python community is that they still want to use the underlying template languages (Django, Genshi, Jinja, etc.) for the heavy lifting. > As in, the user specifies > somewhere (either as an argument/config to sphaml, or at the top of > their source file) how "tag=some_code" should expand? Wouldn't it > always be like: > <tag> START_CODE some_code STOP_CODE </tag> > where START_CODE and STOP_CODE are defined like: > case $language: > "ruby": > START_CODE="<%=" > STOP_CODE="%>" > "php": > START_CODE="<? echo " > STOP_CODE="?>" That would certainly be possible. The code is written now in a fairly functional style, in hopes of allowing extensions. Basically, I want the user to inject their own method of building blocks, which could still borrow logic from the default implementation. > PS. It's nice n' easy how all the code is in one <4 page file. Thanks! That was definitely a goal. :) -- You received this message because you are subscribed to the Google Groups "Haml" group. 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.
