a lua template engine like a famous python template engine jinja2
Lua
Switch branches/tags
Nothing to show
Clone or download
daijun
Latest commit a15bda1 May 10, 2013
Permalink
Failed to load latest commit information.
README lutem_new May 6, 2013
lutem.lua performance optimize May 10, 2013
test.lua lutem fixed May 9, 2013
test.tmpl lutem release 1.0 May 6, 2013
test_sub.tmpl lutem release 1.0 May 6, 2013

README

Welcome
--------------------------
lutem (short for LUa TEMplate engine) is a template render
engine like jinja2(a famous template engine written in Python)
It's used for auto code generation, dynamic html page generation
or other kinds of dynamic text generation


Template Syntax
---------------------------
The syntax is almost the same with jinja2 or Django template, 

Loop generate:

{% for k in mp %}
...  --this area would be repeated
{% endfor %}

variable replacement:
{{ variable/raw }}
variable example: {{ xxx }} {{ tbl.v }}
special raw:  {{ '{{' }}


Template Inheritance
--------------------------------
child template inheritance by parent template:
{% extends abc.tmpl %}

Declare block:
{% block blockname %}
...
{% endblock %}

The child template will overwrite the parent's block content
if correspond block name declared in child template


Example
--------------------------
See the test.lua and test.tmpl