MCPcopy Index your code
hub / github.com/djlint/djLint

github.com/djlint/djLint @v1.40.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.40.3 ↗ · + Follow
409 symbols 2,573 edges 198 files 120 documented · 29% 3 cross-repo links updated 1d agov1.40.3 · 2026-07-04★ 934111 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

djLint Logo

🏗️ Maintainers needed, please reach out on discord or email!

The missing formatter and linter for HTML templates.

<a href="https://twitter.com/intent/tweet?text=djLint%20%7C%20The%20missing%20formatter%20and%20linter%20for%20HTML%20templates.&url=https://djlint.com/&hashtags=djlint,html-templates,django,jinja,developers"><img alt="tweet" src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" /></a>
<a href="https://discord.gg/taghAqebzU">
 <img src="https://badgen.net/discord/online-members/taghAqebzU?icon=discord&label" alt="Discord Chat">

Codecov Status Codacy Status Downloads npm Pypi Download

How to useКак пользоватьсяUtilisation

What lang are you using?

DjangoJinjaNunjucksTwigHandlebarsMustacheGoLangAngular

demo

🤔 For What?

Once upon a time all the other programming languages had a formatter and linter. Css, javascript, python, the c suite, typescript, ruby, php, go, swift, and you know the others. The cool kids on the block.

HTML templates were left out there on their own, in the cold, unformatted and unlinted :( The dirty corner in your repository. Something had to change.

djLint is a community build project to and add consistency to html templates.

✨ How?

Grab it from PyPI with pip

pip install djlint

Or with the community-maintained Homebrew formula on macOS or Linux

brew install djlint

Or with the npm experimental install - Note, this requires python and pip to be on your system path.

npm i djlint

Lint your project

djlint . --extension=html.j2 --lint

Check your format

djlint . --extension=html.j2 --check

Fix my format!

djlint . --extension=html.j2 --reformat

Or use pre-commit to reformat, then lint!

repos:
  - repo: https://github.com/djlint/djLint
    rev: v1.36.4 # use latest version instead
    hooks:
      - id: djlint-reformat
      - id: djlint

💙 Like it?

Add a badge to your projects readme.md:

[![Code style: djlint](https://img.shields.io/badge/html%20style-djlint-blue.svg)](https://www.djlint.com)

Add a badge to your readme.rst:

.. image:: https://img.shields.io/badge/html%20style-djlint-blue.svg
   :target: https://www.djlint.com

Looks like this:

djLint

🛠️ Can I help?

Yes!

Would you like to add a rule to the linter? Take a look at the linter docs and source code

Are you a regex pro? Benchmark and submit a pr with improved regex for the linter rules

⚠️ Help Needed! ⚠️ Good with python? djLint was an experimental project and is catching on with other devs. Help out with a rewrite of the formatter to improve speed and html style for edge cases. Contribute on the 2.0 branch

🏃 Other Tools Of Note

  • DjHTML A pure-Python Django/Jinja template indenter without dependencies.
  • HTMLHint Static code analysis tool you need for your HTML
  • curlylint Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid

Core symbols most depended-on inside this repo

group
called by 134
src/djlint/rules/T027.py
formatter
called by 110
src/djlint/reformat.py
start
called by 23
src/djlint/rules/T027.py
span
called by 19
src/djlint/rules/T027.py
_finditer
called by 18
src/djlint/helpers.py
linter
called by 16
src/djlint/lint.py
get_src
called by 13
src/djlint/src.py
inside_ignored_block
called by 11
src/djlint/helpers.py

Shape

Function 391
Method 11
Class 6
Route 1

Languages

Python92%
TypeScript8%

Modules by API surface

src/djlint/helpers.py33 symbols
tests/test_djlint/test_djlint.py29 symbols
tests/test_linter/test_linter.py26 symbols
src/djlint/settings.py19 symbols
src/djlint/formatter/expand.py15 symbols
tests/conftest.py12 symbols
src/djlint/formatter/indent.py11 symbols
src/djlint/formatter/condense.py11 symbols
tests/test_config/test_gitignore/test_config.py9 symbols
src/djlint/rules/T027.py9 symbols
src/djlint/output.py9 symbols
src/djlint/formatter/attributes.py8 symbols

For agents

$ claude mcp add djLint \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page