Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/ | 23-Nov-2023 | - | 87 | 76 | ||
artwork/ | 23-Nov-2023 | - | 133 | 131 | ||
docs/ | 23-Nov-2023 | - | 4,187 | 2,928 | ||
examples/basic/ | 23-Nov-2023 | - | 140 | 124 | ||
requirements/ | 23-Nov-2023 | - | 98 | 90 | ||
scripts/ | 23-Nov-2023 | - | 75 | 55 | ||
src/jinja2/ | 23-Nov-2023 | - | 12,609 | 9,734 | ||
tests/ | 23-Nov-2023 | - | 7,138 | 5,994 | ||
.editorconfig | D | 23-Nov-2023 | 217 | 14 | 11 | |
.gitignore | D | 23-Nov-2023 | 166 | 21 | 20 | |
.pre-commit-config.yaml | D | 23-Nov-2023 | 714 | 27 | 26 | |
.readthedocs.yaml | D | 23-Nov-2023 | 131 | 9 | 8 | |
Android.bp | D | 23-Nov-2023 | 1,015 | 54 | 50 | |
CHANGES.rst | D | 23-Nov-2023 | 30.8 KiB | 790 | 638 | |
CODE_OF_CONDUCT.md | D | 23-Nov-2023 | 3.3 KiB | 77 | 57 | |
CONTRIBUTING.rst | D | 23-Nov-2023 | 6.2 KiB | 216 | 140 | |
LICENSE.rst | D | 23-Nov-2023 | 1.4 KiB | 29 | 23 | |
MANIFEST.in | D | 23-Nov-2023 | 154 | 10 | 9 | |
README.rst | D | 23-Nov-2023 | 1.8 KiB | 67 | 49 | |
setup.cfg | D | 23-Nov-2023 | 786 | 43 | 38 | |
setup.py | D | 23-Nov-2023 | 1.4 KiB | 41 | 37 | |
tox.ini | D | 23-Nov-2023 | 440 | 20 | 16 |
README.rst
1Jinja 2===== 3 4Jinja is a fast, expressive, extensible templating engine. Special 5placeholders in the template allow writing code similar to Python 6syntax. Then the template is passed data to render the final document. 7 8It includes: 9 10- Template inheritance and inclusion. 11- Define and import macros within templates. 12- HTML templates can use autoescaping to prevent XSS from untrusted 13 user input. 14- A sandboxed environment can safely render untrusted templates. 15- AsyncIO support for generating templates and calling async 16 functions. 17- I18N support with Babel. 18- Templates are compiled to optimized Python code just-in-time and 19 cached, or can be compiled ahead-of-time. 20- Exceptions point to the correct line in templates to make debugging 21 easier. 22- Extensible filters, tests, functions, and even syntax. 23 24Jinja's philosophy is that while application logic belongs in Python if 25possible, it shouldn't make the template designer's job difficult by 26restricting functionality too much. 27 28 29Installing 30---------- 31 32Install and update using `pip`_: 33 34.. code-block:: text 35 36 $ pip install -U Jinja2 37 38.. _pip: https://pip.pypa.io/en/stable/quickstart/ 39 40 41In A Nutshell 42------------- 43 44.. code-block:: jinja 45 46 {% extends "base.html" %} 47 {% block title %}Members{% endblock %} 48 {% block content %} 49 <ul> 50 {% for user in users %} 51 <li><a href="{{ user.url }}">{{ user.username }}</a></li> 52 {% endfor %} 53 </ul> 54 {% endblock %} 55 56 57Links 58----- 59 60- Website: https://palletsprojects.com/p/jinja/ 61- Documentation: https://jinja.palletsprojects.com/ 62- Releases: https://pypi.org/project/Jinja2/ 63- Code: https://github.com/pallets/jinja 64- Issue tracker: https://github.com/pallets/jinja/issues 65- Test status: https://dev.azure.com/pallets/jinja/_build 66- Official chat: https://discord.gg/t6rrQZH 67