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.9.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.9-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.5.9-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.9.tar.gz.

File metadata

  • Download URL: djlintr-0.5.9.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.9.tar.gz
Algorithm Hash digest
SHA256 11deb7ed04d6f65fe2913500ab0fb4439dfe786a171def2acba290604eddf91d
MD5 7592046d16b01df9449d43a8bdbe3ed3
BLAKE2b-256 fc6c750793df10a76e2dd70cc51c3a5d3673a20716bd90debe13bd19e4951cb7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: djlintr-0.5.9-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.9-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e10551b65f82b367a3ea09e70677baedc335c35c286712d08432ece72b27ff5a
MD5 92bc0ee8f098a93b4cfe4198fc01da72
BLAKE2b-256 6b01f68a5b84876843ce8f35c664990038b251ef7e0c2bc0af26f52a4368a9b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.9-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6c8741950b76f62f306ae8ccdf21176d3424f8d76ea3b6d7dec6bf31f74c28ae
MD5 52dbf081c3dd793d7f453648c4e3b146
BLAKE2b-256 c641562ff71b51e30146535b003ecb1fa4bb296257474423bd4921a065c0a0fc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db45760dc1c1bf5181886436cf4676b9ee79feed2996cffaaeee7b320ee2dbd7
MD5 29cd94033772b476074ec28888dc0b5f
BLAKE2b-256 539ba80c7c076287d5585a896bdf4060a61f7f1c43522c8d0c7e8edfc7902cf4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.9-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41ee6d65e0545c762279af7db87c63a87c17c26362c617151be1a3d4e6f441e0
MD5 bb938ceafae2b5c2f7aca02daf2b985d
BLAKE2b-256 d3f5c67ad6f897090ef29cb7f53b387b7e767b26567e8e81ffd598f2c99f51a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.9-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1a7cf17fa4d32e7033086ea934604f7d5ac4ab045e1f57dbcd40b55c9ae21bc1
MD5 f01436f3a96fff5bc6bdb802cda54dca
BLAKE2b-256 f7d458f96df7a7515aafa9a6a73f0559dd8b6863a8a3a56a22077e51871a5ab3

See more details on using hashes here.

Provenance

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