{stache} is yet another mustached template system. It is named after the fact all {stache} specific expressions are quoted by {}, although it's configrable.
{stache} is inspired by {{mustache}}, handlebar, dust (and its LinkedIn port), Django, doT, Smarty, Juicer, Velocity, Jinja2 and Clearsilver.
{stache} consists of two parts:
- {stache} Template Language
- Implementation for the target language
- performance, performance, performance: compile template into target language; cache
- cross-language: C++, Java, Python, PHP, Javascript/Node, Javascript/Browser, Actionscript
- keep it simple and stupid: general-purpose; no i18n support; no xss escape
- powerful and pratical: no MVC fundamentalism; logic-enabled to solve common problems in an easy way;
- extendable: user defined functions
- configurable: delimiter
- thread-safety / immutable: compile once, render multiple times in parallel
- unicode supported
Some implementation details that may be considered:
- async function definition to enable possible parallel execution
- stream interface for rendering
- support bigpipe by async module: content, js, css, alt
- compile js css if needed given the global dependency
stache.render(tmpl, context)
tmpl_ = stache.compile(tmpl)
tmpl_.render(context1)
tmpl_.render(context2)
tmpl_ = stache.compile(tmpl)
tmpl_.store("compiled.tmpl")
tmpl_ = stache.load("compiled.tmpl")
tmpl_.render(context1)
tmpl_.render(context2)