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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ x86-64

djlintr-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.6.1-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.1.tar.gz.

File metadata

  • Download URL: djlintr-0.6.1.tar.gz
  • Upload date:
  • Size: 102.9 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.1.tar.gz
Algorithm Hash digest
SHA256 ca4bf6fab7db48ec34b6ad5632b994d8b52fd5b2e807aa03db4fc636d74a4140
MD5 38dc610c1865f01e65062289e4147879
BLAKE2b-256 d9ce4d8ef6b4f1b36a9de122c354f382d5c4acb1bee9eb1f17ce4f0aa7855143

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: djlintr-0.6.1-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.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a2368bab3b3630a542662d38e15c6f3dff1e4a3dd60238610502fc0915e830a5
MD5 23923bea6efdd6dab1e95dff9da826e7
BLAKE2b-256 c31770818b21bae1d967fa2bc8938c2c6b4c96bcb025e8e313ee5e44372446de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.6.1-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4c198e469b5b663a602613bab275fa8d53e8c05d9161e0ea51430b35d4d3948b
MD5 3f5bab8dda8886f7d1b22c5cb27f9c33
BLAKE2b-256 d00a6f976a6e44fc8a4e21c88b949f56971bc3360eaddea94a623a23f3c72920

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 03096e9eab53cf61f9aeadf923e7e26a43e735b8e0222d21009579f23d866ee9
MD5 85189190b9f034a8622ef8818d9eb353
BLAKE2b-256 50b92e1665f9e2202833025a4c69593436b8a50e92c43b2f83f9e74f693db478

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.6.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 348734aa3016ee4d5a56b8b810f46e7aa70bfacc52105005ae40501578ca7e87
MD5 e73b07c2576bf36eeff80fc6213e8c15
BLAKE2b-256 0298d65d0e20cde2f964397431d19df1dd45095a0b54aec02aa91265d6114991

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.6.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 506f2fb0d87b127abafbb481e4cdb2c10c874b306ada5f19a7416ccce7fc38c5
MD5 85c4e9382cf20b10310bb5d6f71b9d78
BLAKE2b-256 f3dae281e46233e2abe3f918660b8b87760938d1445a9a768a35ac662e62c50d

See more details on using hashes here.

Provenance

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