Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebars helpers #16

Open
xxgreg opened this issue Feb 12, 2015 · 2 comments
Open

Handlebars helpers #16

xxgreg opened this issue Feb 12, 2015 · 2 comments

Comments

@xxgreg
Copy link
Owner

xxgreg commented Feb 12, 2015

Add a simple version of helpers as implemented in handlebars.js.

http://handlebarsjs.com/

var t = new Template(
                     '{{ uppercase foo }}',
                     helpers: {'uppercase': (ctx) => ctx.arguments[0].toUppercase()});

 t.render({'foo': 'bar'}); // outputs 'BAR'

These can also be used with sections.

Initial hacky implementation here:

https://github.com/xxgreg/mustache/tree/handlebars-helpers

@MikeMitterer
Copy link

👍

@xxgreg
Copy link
Owner Author

xxgreg commented Apr 26, 2015

I'm unfortunately busy with other things at the moment. But I recently rewrote the parser to make it easier to implement helpers. Have a crack at this if you are interested - I'm happy to help with reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants