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.0.0.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file jinja2-git-1.0.0.tar.gz
.
File metadata
- Download URL: jinja2-git-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.4 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f85cfb11963771769615580b6ac3d9ff9f73a8f659fa2c656417408727ca0a7 |
|
MD5 | 90df6218069f64c6631aae674981d01a |
|
BLAKE2b-256 | 75428834d3f23e37af9a4f332dbb2bb9494efe2bd770c63f3c8c874aaec0f0a1 |
File details
Details for the file jinja2_git-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: jinja2_git-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.7.4 Darwin/18.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12a27dd492b4dbd07d634d5e6d19efc2fed430333f80083f064b5ec39627c67 |
|
MD5 | 1eeb893bed70c3d80ad10016964f4f0f |
|
BLAKE2b-256 | 7ee127edeaf581b105ad0e7eee7676367f1d689a47c90a27395f5bdf9e009dfc |