News for hackers. Stuff that matters.
Re:Mustache 2.0 and the Future of Mustache.js by davisp on Sunday February 13, 2011 @04:07PM (#2213937)
Yes to else sections. The lack of else is just plain annoying after awhile.

Don't care on dotted access.

Context addressing is fine if we can agree on a method and keep the spec simple. Perhaps using Git's SHA addressing with things like HEAD, HEAD^, HEAD^^ or similar.

Yes to booting dynamically changing delimiters.

Yes to stealing helpers.

For cross-language compatibility, we really should have a collection of test inputs and outputs.

We should adopt a directive thing like you have for the 'this' notation with {{.}} or whatever for lists. The original is a bit funny looking but I think this sort of thing would fix the delimiter issue.

Another pattern that I run into that's a bit weird is when I need to add markup around a list when its not empty. I end up having a context that returns a context with a rows object when there is data, or None when there are no rows. So it looks like this in mustache:

{{#genes}} open table {{#rows}} row stuff {{/rows}} end table {{/genes}}

I keep having the feeling there's a better way to make that work.

If I get another project finished up shortly I'll write these up in a branch of pystache.

Re:Mustache 2.0 and the Future of Mustache.js by judofyr on Sunday February 13, 2011 @04:17PM (#2213968)
> For cross-language compatibility, we really should have a collection of test inputs and outputs.

https://github.com/mustache/spec

Re:Mustache 2.0 and the Future of Mustache.js by binspace on Sunday February 13, 2011 @05:40PM (#2214238)
> {{#genes}} open table {{#rows}} row stuff {{/rows}} end table {{/genes}}

JSON templates has an interesting solution.

http://json-template.googlecode.com/svn/trunk/doc/Introducin...

{.section genes} open table {.repeated section @} row stuff {.end} end table {.end}