Git Product home page Git Product logo

stache's Introduction

{stache}

{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:

  1. {stache} Template Language
  2. Implementation for the target language

Design Principles

  • 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

Typical Workflows

In-place render:

stache.render(tmpl, context)

Compile once at runtime, render many times:

tmpl_ = stache.compile(tmpl)
tmpl_.render(context1)
tmpl_.render(context2)

Compile into file, load later then render:

tmpl_ = stache.compile(tmpl)
tmpl_.store("compiled.tmpl")

tmpl_ = stache.load("compiled.tmpl")
tmpl_.render(context1)
tmpl_.render(context2)

stache's People

Contributors

yesme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.