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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.34+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

djlintr-0.5.11-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.11.tar.gz.

File metadata

  • Download URL: djlintr-0.5.11.tar.gz
  • Upload date:
  • Size: 86.3 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.11.tar.gz
Algorithm Hash digest
SHA256 590638a78d41e9ee8e0847193b2f5e0c7b6805424f88c08f76bbf560934aa62d
MD5 2cdc77f5dd373d79fd7e8eda8c0fcbbe
BLAKE2b-256 2fbf027bd9d3c707ab153ebf232f83c9c1cdb3601d638d7fd59a9e5c27d27ad5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: djlintr-0.5.11-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.11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dd7858f6a0db1e87ec86dba11a5e69d1dfa88dbfce0b959e543c946b9ee79404
MD5 b6fe5cd4e9b8420f2f72abd4bd9bacce
BLAKE2b-256 f3ad0f0f1b4b23cc1de7c911a41c21f70400d8372fdf9d4bd0bf581cbca7f3f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.11-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dcaf2dcfabfba6e5592f781b1e047e33629eaa2588954896189f907ae73dcc84
MD5 5dc0433a81ba33120bffb8929b1bdf91
BLAKE2b-256 df329d10d9715550b897bc550bef2620f95c7bc38983ee0803f41452c0bd2cf9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 930695989dab475f3c920f47be997df0121be4d99e6a7e13668a8641e8699cb2
MD5 c96e1a35b0c21060c794d2241ea80b55
BLAKE2b-256 d8e75ef8296b6a95487f54c63bf594533485f301a576b5e02a428ec13cf0e439

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 209e43e5bd64c62548315edfba0dfb95cae53d4cedc6c8c98e56431e80bafb66
MD5 745741884316ae7fa5cd55e4e265c46b
BLAKE2b-256 be087d8eb70c53c2b2c9f8868f77d8d573ebfd92ae85ec90d95a9ebe77f83511

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for djlintr-0.5.11-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f8cec32f21bedfa69a064b65ecc5595ed06fb1cba005ef02cf4d969fb3bca19d
MD5 b16dd03c1b5ec68a32889bb0b5e546a7
BLAKE2b-256 5eb5dfc117dfb712dab821e492706dc15ec234b1efe582683ea32a73ae8dd58c

See more details on using hashes here.

Provenance

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