Jinja2 extension to handle git-specific things
Project description
Jinja2 extension to handle git-specific things
Installation
$ pip install jinja2-git
Reasoning
This plugin is used to render commit hash in jinja2
templates. We are
using it to render our template version in cookicutter
:
Usage
Add it as an extension for jinja2 or cookiecutter.
And then inside a template:
from jinja2 import Environment
env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0
Or short version:
from jinja2 import Environment
env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit short=True %}')
# => Commit is: c644682
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2-git-1.1.0.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file jinja2-git-1.1.0.tar.gz
.
File metadata
- Download URL: jinja2-git-1.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 366107d03df0c3ff549c9ccf922a92cb763453fc613e5651123aaa38233c61d0 |
|
MD5 | d2e4dc1991b7f036eec87dec03d83080 |
|
BLAKE2b-256 | 6e9454195f21fb1c443364f8c3689d36d9eae3ec33d2bf26bb5403a58cfebdcb |
File details
Details for the file jinja2_git-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: jinja2_git-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e06cac17a8bc18b277af78417f04886b50dda446a20250f85c1ffbce534daa36 |
|
MD5 | 65fd32ba4c14b016d9d3401788887cf0 |
|
BLAKE2b-256 | ed446213a04dd697c54958ecc5732742b478bb088057da62bb3acdc319f73435 |