jquery.mustache let you write your Mustache.js templates in plain text files and then combine them in one JS file (a jQuery plugin) making it easy to render your templates. It also helps you dealing with i18n issues in your templates.
The template "banner" in the file "banner.ms":
The template "page1" in the file "page1.ms":
The template "page2" in the file "page2.ms":
How you can render these templates in your JS code:
You don't have to specify your partials, you can use whatever template name you have written (here "banner").
How it works
jquery.mustache features a python script which you run once you have written or updated your templates files. This script generates one or more files named as template_en.js (for English version here) plus generate/update i18n (po/mo) files using xgettext / msgfmt.
You include the generated file in your page as a regular js file, and then you can use the "renders" function on jQuery elements!
The generated file looks like:
You can see a working example in the example directory. Just go there and type "make" to see it in action.
Have fun and don't hesitate to comment / report issues…
jquery.mustache GitHub page: http://github.com/AF83/jquery.mustache