Skip to content
/ lutem Public

a lua template engine like a famous python template engine jinja2

Notifications You must be signed in to change notification settings

daly88/lutem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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


About

a lua template engine like a famous python template engine jinja2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages