blob: a142c6da8d1112caaf7297d58f4b802f3d7777c8 [file] [log] [blame]
Armin Ronacherf55b1a42010-10-17 15:58:08 +02001Jinja2
2~~~~~~
3
4Jinja2 is a template engine written in pure Python. It provides a
5`Django`_ inspired non-XML syntax but supports inline expressions and
6an optional `sandboxed`_ environment.
7
8Nutshell
9--------
10
11Here a small example of a Jinja template::
12
13 {% extends 'base.html' %}
14 {% block title %}Memberlist{% endblock %}
15 {% block content %}
16 <ul>
17 {% for user in users %}
18 <li><a href="{{ user.url }}">{{ user.username }}</a></li>
19 {% endfor %}
20 </ul>
21 {% endblock %}
22
23Philosophy
24----------
25
26Application logic is for the controller but don't try to make the life
27for the template designer too hard by giving him too few functionality.
28
29For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
30
31The `Jinja2 tip`_ is installable via `easy_install` with ``easy_install
32Jinja2==dev``.
33
34.. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
35.. _Django: http://www.djangoproject.com/
36.. _Jinja2 webpage: http://jinja.pocoo.org/
37.. _documentation: http://jinja.pocoo.org/2/documentation/
Caleb Williamsdd0f3982014-04-16 23:44:56 -050038.. _Jinja2 tip: http://jinja.pocoo.org/docs/intro/#as-a-python-egg-via-easy-install