https://github.com/louisdevie/jinja2-td
https://github.com/louisdevie/jinja2-td
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/louisdevie/jinja2-td
- Owner: louisdevie
- License: other
- Created: 2022-11-04T17:21:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T17:55:53.000Z (over 2 years ago)
- Last Synced: 2025-03-04T04:47:45.610Z (3 months ago)
- Language: Python
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE_JINJA2
Awesome Lists containing this project
README
# Jinja2-TD 
Provides information about Jinja2 template dependencies.
## Install
```sh
pip install Jinja2-TD==3.x.x
```## Example
```python
...my_template = env.get_template("my_template.j2")
...
template_info = env.dependencies.get_template("my_template.j2")
parent = template_info.get_parent()
if parent is not None:
print("This template extends", parent.target.name)
else:
print("This template doesn't extend another")
```[Go read the docs!](https://jinja2-td.readthedocs.io)