launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #08829
Re: 'stache, handlebars, tal and so forth
On Tue, 31 Jan 2012, Robert Collins wrote:
> On Tue, Jan 31, 2012 at 2:52 PM, Richard Harding
> <rick.harding@xxxxxxxxxxxxx> 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
Follow ups
References
-
'stache, handlebars, tal and so forth
From: Robert Collins, 2012-01-25
-
Re: 'stache, handlebars, tal and so forth
From: Marc Tardif, 2012-01-27
-
Re: 'stache, handlebars, tal and so forth
From: Richard Harding, 2012-01-30
-
Re: 'stache, handlebars, tal and so forth
From: Marc Tardif, 2012-01-30
-
Re: 'stache, handlebars, tal and so forth
From: Richard Harding, 2012-01-31
-
Re: 'stache, handlebars, tal and so forth
From: Robert Collins, 2012-01-31