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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.5.13-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.13.tar.gz.

File metadata

  • Download URL: djlintr-0.5.13.tar.gz
  • Upload date:
  • Size: 87.2 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.13.tar.gz
Algorithm Hash digest
SHA256 1dfe1d06b1bdf0fb555867359cc00e8bd6570214ba253866eaad17f6066ba203
MD5 14e8ee4dd16e94b43d832945fba19fab
BLAKE2b-256 d08bab059523550193f8a02071d6320ae8e908ec3e21a5081f3b54c66bca9952

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: djlintr-0.5.13-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.13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f76740dde79fd571089146daafc68ec46334a2250925c91965a71a04528e3f1f
MD5 10357eb9e2bad6b3db433e78999b4f61
BLAKE2b-256 fdd20909bbd520841e231a4ee122fd902c2b37433029f33efd1ba2899f47458d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.13-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7e5700ea17614eb5db8c1a4c56106c25a95bdfa7ee0883ed11a1137962cc09c9
MD5 1c24b376debf3a75138f3d4d5aaff1c0
BLAKE2b-256 f0c8e47dd15821e23549718da764c0e7f0f0ba0c82259cb0b398ef755c2dca06

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8fdc9b917e3f23020cb27414f2a1dfbc632432d4a241d5072cfeae9b03a7e93f
MD5 9bcc8301fc1bbd08e23a29b4ebfa66dd
BLAKE2b-256 80e85b9f25f24c9c1d8ae793fea63f9259a4187c432d7fc9823904afccd1d46c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.13-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c6e7f7bba5f5c7c45235d9f5cb95fe014a2bfad9f8847ec63c50dc7b4171a4f
MD5 833018e7cb20199e6790c3df1f41eba3
BLAKE2b-256 f7c802a5665a997de29b668c4ebf0289c93bcefdd531ceb9cfc85df003ef185c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.13-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b234e8ae288d07526aaf70e6ee73eeebf01e185f7e8aad54f2cdc70663b59b54
MD5 959314cfecb3e261adae00870db35136
BLAKE2b-256 a7bb3bc0cdbdc85fbd614fa38d41d18d78e1f4ea3940b2623bfd878677dae7df

See more details on using hashes here.

Provenance

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