Skip to main content

A fast HTML template linter and formatter, ported from djlint to Rust.

Project description

djlintr

A fast HTML template linter and formatter. Port of djlint to Rust.

Currently only supports HTML and Django templates; Jinja2 and Nunjucks to be added in the future.

Installation

You can install djlintr directly from PyPI using pip or uv:

pip install djlintr
# or
uv pip install djlintr

Alternatively, you can grab one of the binary release files from GitHub.

Or, to install djlintr from source, ensure you have Rust installed and run:

cargo install --path .

Usage

djlintr [OPTIONS] <PATHS>...

Arguments

  • <PATHS>...: Files or directories to process.

Options

  • -r, --reformat: Reformat files.
  • -l, --lint: Lint files.
  • -e, --extension <EXTENSION>: File extensions to include (default: html).
  • -t, --threads <THREADS>: Number of threads to use.
  • --check: Return non-zero exit code if issues are found.
  • --max-attribute-length <MAX_ATTRIBUTE_LENGTH>: Maximum length for attributes before wrapping (default: 70).
  • --custom-blocks <CUSTOM_BLOCKS>: Comma-separated list of custom block tags.
  • -h, --help: Print help.
  • -V, --version: Print version.

Configuration

djlintr automatically searches for a .djlintrc (JSON) file or a pyproject.toml file in the current directory.

Supported Options

  • indent: Number of spaces for indentation (default: 4).
  • max_line_length: Maximum line length (default: 120).
  • max_attribute_length: Maximum length for attributes before wrapping (default: 70).
  • ignore: A list of rule codes to ignore.
  • custom_blocks: A list of custom block tags.

Example .djlintrc

{
  "indent": 2,
  "max_line_length": 100,
  "ignore": ["H006", "T001"]
}

Example pyproject.toml

djlintr supports both [tool.djlint] and [tool.djlintr] sections.

[tool.djlintr]
indent = 2
max_line_length = 100
ignore = ["H006", "T001"]

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

djlintr-0.6.0.tar.gz (97.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

djlintr-0.6.0-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

djlintr-0.6.0-py3-none-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

djlintr-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

djlintr-0.6.0-py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.6.0-py3-none-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file djlintr-0.6.0.tar.gz.

File metadata

  • Download URL: djlintr-0.6.0.tar.gz
  • Upload date:
  • Size: 97.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djlintr-0.6.0.tar.gz
Algorithm Hash digest
SHA256 28ed14fd9611f0da08c2bfeb13a57144868024c7fe1b353e5af13f0561c381ab
MD5 1a7d05a6e69ac71c1cc187eba55abf4a
BLAKE2b-256 0a6b1511bb0616d11ec3f9e1d1c28541966365c6c75ff2f9bc69116204028ce1

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0.tar.gz:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.6.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: djlintr-0.6.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for djlintr-0.6.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fd5aec73ca5158f6857788d1e5a11c90509556e770a244e4abc969db4822ac5f
MD5 1bafb787ebd76752f3d08457f70a399c
BLAKE2b-256 de4324cf33afe398007fb5dad1cc60aa5770ed73526ba960006acdd3417ca977

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0-py3-none-win_amd64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.6.0-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.6.0-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b0772ad62ce58b3c01458a21494ae16c6c415558428e23ca247bf7361968dcf9
MD5 8b3d15b42a3bf2a26f8e92e64b3b3129
BLAKE2b-256 770dbd7d47ac7fb6093e6efbb6064658cba69929e8b6dcf0ff3920c207707268

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0-py3-none-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for djlintr-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ffa5796629f1813bbfe3c80d77906a6d18850a20f7a6e7b825a84e72f3a074c
MD5 55564fe97b46c1e8e85f0f8778d48b69
BLAKE2b-256 91a709c5260fccef07323e8e52d7250ac3efe88c7928ea24098758812614f79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.6.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for djlintr-0.6.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a5724043e5bcbdfd6ca0ad46925cb4abb9f355339e799355c24e9f1f104d7f9
MD5 17c32eff3d547a5ccebf46a425c2f6cc
BLAKE2b-256 dad78d7aee407fa225ea1f6a84ef2e341760b38c962abb1c152cc9c6e5fdac39

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0-py3-none-macosx_11_0_arm64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djlintr-0.6.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.6.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ec2d2a71f81d0cdf3ae11689c23c97aed5a175bf7ad6309d04e3aacbafd01b0b
MD5 3b799ada092bbb87be1cc805a60a2e07
BLAKE2b-256 4fa00fd122e242770877e03e06adbac38df2bd282ae2ae8fd96122064e577e05

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.6.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: pypi.yml on thraxil/djlintr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page