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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djhtml-0.0.3.tar.gz | 19.2 kB | Without provenance | Details for djhtml-0.0.3.tar.gz |
Release files / djhtml-0.0.3.tar.gz
| Download URL | djhtml-0.0.3.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d9d1ff24dcc8755be5a3e2b2ae2c0573102fd44c5de678efd616333e233ed41
|
|
BLAKE2b-256 checksum How to use checksums |
5145bf5f048ab4eb544ce6bd8391776df04d2a941434960cb95889f62c639b2f
|
| 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
|
Security for djhtml 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.