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.5.10.tar.gz (81.7 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.5.10-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.5.10-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.5.10.tar.gz.

File metadata

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

File hashes

Hashes for djlintr-0.5.10.tar.gz
Algorithm Hash digest
SHA256 98aa73aeb19d9da08ea9351c3f159ea68202a8882de24183bf09cc8fa2b3442f
MD5 a7260ed4b514b57568244c786cd141a3
BLAKE2b-256 cfb018cc7bba8fe7b904690c51ef1fa4663668f607cfef16010499af0c77c3cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10.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.5.10-py3-none-win_amd64.whl.

File metadata

  • Download URL: djlintr-0.5.10-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.5.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2187075a5868bafd334b130d0ad319cd0180f5d327e8be8fc8a3eda35614bffd
MD5 be407bc9ed295d25ea01f7023fd9ea44
BLAKE2b-256 fa405fe4bf06868b6bbc0583cc60dc01b1ebf1a88154245a163f1272453031af

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10-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.5.10-py3-none-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.10-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fc046c411fc0a87f8add0b754faefadd9cd92ebd2d1dd2f7d193e3bbba501267
MD5 45132f6a972c66c6c81eb664c70cca51
BLAKE2b-256 c6452d599c219aa285c11719802f89359899f9a6779ceaf7289c7f79c770895a

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10-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.5.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 70d527498d64059a409ee70f1bc97f8e904cd7057658df2b2f4ae1bb89051744
MD5 0ba3d86de207e53d26fb6806f58b5868
BLAKE2b-256 c46b99a2290347a61be921a769a1c2ce236403ea2966e7059faebe9508076dea

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10-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.5.10-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2496b449bbb91546eaa79c0d7afac30fe5ac840c60445658e7a87b295f58485
MD5 1d63d6c262b5ace95e94b9ab3bae6824
BLAKE2b-256 ab579d094c0c1c9729185f21bda1f360f55cef6f4a9f1df5a887d37bd7dfc772

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10-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.5.10-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for djlintr-0.5.10-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dfcf9899a3a7ee117721b9a27cab6d3264f693c60a9cf39bbbc16ec52570c6e8
MD5 d0d32ca96d596513f453f125c6b57f3b
BLAKE2b-256 718f1bc80853c279b98a69f7b1afaba53cf8b1d9861717f1c3e0d2846d70561f

See more details on using hashes here.

Provenance

The following attestation bundles were made for djlintr-0.5.10-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