Skip to content

Instantly share code, notes, and snippets.

@documentcloud
Created November 15, 2009 04:52
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save documentcloud/234982 to your computer and use it in GitHub Desktop.
Save documentcloud/234982 to your computer and use it in GitHub Desktop.
// Add a Mustache.js templating function to your JavaScript:
Mustache.template = function(templateString) {
return function() {
return Mustache.to_html(templateString, arguments[0], arguments[1]);
};
};
// And then, in assets.yml, you can set "template_function" to "Mustache.template".
@agibralter
Copy link

I was just trying to help someone get setup for Jammit+Mustache.js, and I noticed that this template function makes it very difficult to use partials. I updated my fork of this gist to make it a bit more versatile: https://gist.github.com/371734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment