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

Document Mustache Templates #22

Closed
svperfecta opened this issue Sep 8, 2012 · 2 comments
Closed

Document Mustache Templates #22

svperfecta opened this issue Sep 8, 2012 · 2 comments

Comments

@svperfecta
Copy link
Contributor

Hi @css - Could you explain how you're intending that I use mustache templates with Pipe?

I assumed I could do something like this:

//= require file.js
//= require template.mustache

This parses, but doesn't do what I expected. I assumed it would somehow wrap my template files up so that they are accessible via my other JS files. Instead it just puts the template code inline in my Javascript (which doesn't parse). What should I be doing here?

Thanks!

@CHH
Copy link
Owner

CHH commented Sep 8, 2012

Yeah, as you said, mustache is not working very well. That it's supported is only due to the fact that Pipe is built on top of Metatemplate. So the way to go would be to create an engine like Sprockets' JST engine. So then you would put your mustache code into .jst files and do a //= require template.jst.

Then the template's code would be available in Javascript via JST["template"].

@svperfecta
Copy link
Contributor Author

Thanks. I may just look into it. Great work with pipe. It's sorely needed.

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