Skip to content

Commit

Permalink
Merge pull request #7 from mikhail-akimov/Issue-6
Browse files Browse the repository at this point in the history
Converting README.rst to README.md and fixing pyproject.toml
  • Loading branch information
sobolevn committed Sep 25, 2018
2 parents 0384c67 + 4a63296 commit 5f83fe6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 47 deletions.
39 changes: 39 additions & 0 deletions README.md
@@ -0,0 +1,39 @@
# Jinja2 extension to handle git-specific things

[![Travis](https://travis-ci.org/sobolevn/jinja2-git.svg?branch=master)](https://travis-ci.org/sobolevn/jinja2-git)
[![Coveralls](https://coveralls.io/repos/github/sobolevn/jinja2-git/badge.svg?branch=master)](https://coveralls.io/github/sobolevn/jinja2-git?branch=master)
[![PyPI version](https://badge.fury.io/py/jinja2-git.svg)](http://badge.fury.io/py/jinja2-git)
[![Dependencies Status](https://img.shields.io/pypi/pyversions/jinja2-git.svg)](https://pypi.python.org/pypi/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`:

- [wemake-django-template](https://github.com/wemake-services/wemake-django-template)
- [wemake-vue-template](https://github.com/wemake-services/wemake-vue-template)

## Usage
-----

Add it as an extension for
[jinja2](http://jinja.pocoo.org/docs/2.10/extensions/) or
[cookiecutter](http://cookiecutter.readthedocs.io/en/latest/advanced/template_extensions.html).

And then inside a template:

```python
from jinja2 import Environment

env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0
```

## Installation
------------

```bash
$ pip install jinja2-git
```
46 changes: 0 additions & 46 deletions README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -9,7 +9,7 @@ authors = [
"Nikita Sobolev <mail@sobolenv.me>"
]

readme = "README.rst" # Markdown files are supported
readme = "README.md" # Markdown files are supported

repository = "https://github.com/sobolevn/jinja2-git"
homepage = "https://github.com/sobolevn/jinja2-git"
Expand Down

0 comments on commit 5f83fe6

Please sign in to comment.