You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
978 B

4 years ago
  1. Jinja2
  2. ~~~~~~
  3. Jinja2 is a template engine written in pure Python. It provides a
  4. `Django`_ inspired non-XML syntax but supports inline expressions and
  5. an optional `sandboxed`_ environment.
  6. Nutshell
  7. --------
  8. Here a small example of a Jinja template::
  9. {% extends 'base.html' %}
  10. {% block title %}Memberlist{% endblock %}
  11. {% block content %}
  12. <ul>
  13. {% for user in users %}
  14. <li><a href="{{ user.url }}">{{ user.username }}</a></li>
  15. {% endfor %}
  16. </ul>
  17. {% endblock %}
  18. Philosophy
  19. ----------
  20. Application logic is for the controller but don't try to make the life
  21. for the template designer too hard by giving him too few functionality.
  22. For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
  23. .. _sandboxed: https://en.wikipedia.org/wiki/Sandbox_(computer_security)
  24. .. _Django: https://www.djangoproject.com/
  25. .. _Jinja2 webpage: http://jinja.pocoo.org/
  26. .. _documentation: http://jinja.pocoo.org/2/documentation/