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.3.0.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file jinja2-git-1.3.0.tar.gz
.
File metadata
- Download URL: jinja2-git-1.3.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.0 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20b15497548cf86eefb116b11141e30ed2a690e0ea5d71f0e5cd17ccdf77491a |
|
MD5 | 6aabb1dd227213307c27e0f3731f7cfb |
|
BLAKE2b-256 | 31e6ab8fab3707923968873f78f0c17de9dbeed21950db5c71eeb9056c674466 |
File details
Details for the file jinja2_git-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: jinja2_git-1.3.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.0 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b12d160e898b0afd6a9903c3d67c5c8fb7383674b34d79f3604681e95bd4f536 |
|
MD5 | d13489aecc0da2c5424a20e7959a657a |
|
BLAKE2b-256 | ff28bff32e3580d051643d041794006eb9bba9ecdb64e591ffd708129cc0adbb |