Skip to main content

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)

Source distribution for djhtml 0.0.2
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

Release history Release notifications | RSS feed

3.0.11

2 release files

3.0.9

2 release files

3.0.8

1 release file

3.0.7

1 release file

3.0.6

1 release file

3.0.5

1 release file

3.0.4

1 release file

3.0.3

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.0.0

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.14

1 release file

1.4.13

1 release file

1.4.12

1 release file

1.4.11

1 release file

1.4.10

1 release file

1.4.9

1 release file

1.4.8

1 release file

1.4.7

1 release file

1.4.6

1 release file

1.4.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

0.0.3

1 release file

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page