DJHTML
A pure-Python Django template indenter without any dependencies.
Installation
You can install DJHTML with the following command:
$ pip install djhtml
Usage
Next, you can use it like so:
$ djhtml my-django-template.html
Pre-commit configuration
Even better, you can use DJHTML as a pre-commit hook to automatically indent your Django templates upon each commit.
First, add the following to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/rtts/djhtml
rev: main
hooks:
- id: djhtml
Then, run the following command:
$ pre-commit autoupdate
Results
Before:
{% block extrahead %}
<script>
function f() {
return 42;
}
</script>
{% endblock %}
After:
{% block extrahead %}
<script>
function f() {
return 42;
}
</script>
{% endblock %}
Metadata
Release files for djhtml 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djhtml-0.0.2.tar.gz | 8.5 kB | Details |
Release files / djhtml-0.0.2.tar.gz
| Download URL | djhtml-0.0.2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25b11e9df0e39f54da558ef26d5deb90039bc49850affa7ff482e0073cd607c4
|
|
BLAKE2b-256 checksum How to use checksums |
0ff888d192983f175efe1b1a759348df3e3082ff644b609cf7b2d9f6999c3eda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|