Skip to content

jmoiron/mandira

Repository files navigation

મંદિર Mandira

Build Status Godoc license

Mandira is a language agnostic logic-light templating system desigend to be usable on server and client side applications. Mandira strives to be easy to learn, easy to implement, efficient to render, comfortable for designers, tollerable for developers, suitable for non-HTML documents, as flexible as necessary (but no more so), and consistent in style and rendering.

It is heavily influenced by Mustache, Tempo, Django Templates and Jinja2

Mandira templates should look familiar to users of other templates. It is called "logic-light" because it allows some forms of conditional logic while avoiding the complexity of more sophisticated features. It strives for both simplicity and ergonomics, but makes concessions to each where appropriate.

Sample

A simple Mandira template:

{{#greetings}}
  {{?if greeting|len > 4}}
    {{greeting}}
  {{?else}}
    {{greeting}}, {{name}} ({{age}})
  {{/if}}
{{/greetings}}

Given the following context:

{
  "name": "Jason",
  "greetings": [
    {"greeting": "Hello"},
    {"greeting": "Hi"}
  ],
  "age": 30
}

Will produce the following:

Hello
Hi, Jason (30)

Status

Currently, Mandira has a specification and a beta quality reference implementation in Go. It is currently the template language in use on my personal website. I intend to get feedback on it and live with it a while and see what works and what doesn't.

If you are interested in this language and the ideas behind it, read my Logic-less Template Redux blog post or ping @jmoiron on twitter. The name Mandira is sanskrit for "Temple", and the script used in the title is Mandira in Gujarati.

About

language agnostic logic-light template system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published