On Tue, 31 Jan 2012, Robert Collins wrote: > On Tue, Jan 31, 2012 at 2:52 PM, Richard Harding > <rick.hard...@canonical.com> wrote: > > Yes, you are correct. This then gets into why some of us aren't the biggest > > fans of Mustache as a template language. A very similar language with > > similar syntax is Handlebars. The nice thing about handlebars is that it > > supports the idea of helpers. > > > > http://handlebarsjs.com/#helpers > > > > If you follow that idea you could see writing a json_dateparse helper that > > you could register and use in your template > > I think that that is a quirk of moustache.js, as pystache supports > external helpers (and moustache started in ruby, so ... I suspect > in-context helpers is a bogon :) > > -Rob
I was looking through the documentation of the overall mustache spec vs any implementation: http://mustache.github.com/mustache.5.html I don't see any other way than going the route of defining a lambda and adding it to the model instances as you passed them in to render. It does look like the Ruby implementation has the concept of helpers, and checking the pystache code it looks like it has some ability to create Modifiers? Is this what you're referring to? -- Rick Harding Launchpad Developer https://launchpad.net/~rharding @mitechie _______________________________________________ Mailing list: https://launchpad.net/~launchpad-dev Post to : launchpad-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-dev More help : https://help.launchpad.net/ListHelp