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

Q: how does the plugin handle 'known template helper functions' ? #1

Open
zackd opened this issue Jun 8, 2012 · 3 comments
Open

Q: how does the plugin handle 'known template helper functions' ? #1

zackd opened this issue Jun 8, 2012 · 3 comments

Comments

@zackd
Copy link

zackd commented Jun 8, 2012

nice plugin !

just wondering though, usually I have a bunch of template helper functions defined e.g.
Handlebars.registerHelper('someFunction', function () { .. etc

And then I would compile using -k flag to 'register' the template helper function e.g.
handlebars rawTemplate.handlebars -f output_dir/compiledTemplate.js -k someFunction

does the plugin support this?

@sheehan
Copy link
Owner

sheehan commented Jun 8, 2012

Not yet. I'll look at adding that next. The only way I can see to pass that info to the mapper per resource would be to use the attrs Map. I'll investigate and get back to you.

@zackd
Copy link
Author

zackd commented Jun 11, 2012

nice.
btw I run a bash script to do handlebars compile atm, and I'm storing a '-' separated list of know template helpers as a data attribute on template script tags e.g.
<script id="someTmpl" type="text/x-handlebars-template" data-compile="if-else-unless-someFunction-someOtherFunction"> .. nice and easy to maintain

@trashhalo
Copy link

As of 0.3.6 you can specify known helpers on a global level. Not yet on an individual file level.

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

3 participants