HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
Find a file
2023-02-13 10:43:53 -06:00
.github chore(deps) Update all non-major dependencies 2023-01-23 10:26:03 +00:00
docs Merge pull request #546 from Riverside-Healthcare/renovate/all-minor-patch 2023-02-13 10:26:47 -06:00
src/djlint fix(config): added error message print when config loading fails 2023-02-07 08:53:38 -06:00
tests fix(config): added error message print when config loading fails 2023-02-07 08:53:38 -06:00
.coveragerc fixed test coverage 2021-08-17 08:56:40 -05:00
.editorconfig feat(npm): updated npm installer 2022-07-06 11:24:45 -05:00
.flake8 flake8 is not yet compatible with pyproject.toml 2022-09-22 11:35:05 +02:00
.gitignore updated release and gitignore 2022-01-03 16:50:21 -06:00
.pre-commit-config.yaml chore(deps) Update pre-commit hook psf/black to v23 2023-02-06 13:47:15 +00:00
.pre-commit-hooks.yaml use types for others 2022-07-05 17:06:50 +01:00
.prettierignore feat(npm): updated npm installer 2022-07-06 11:24:45 -05:00
.prettierrc feat(npm): updated npm installer 2022-07-06 11:24:45 -05:00
.releaserc updated demo 2022-12-16 09:22:11 -06:00
build_demo.sh fix(docs): fixed doc build 2023-01-19 13:11:34 -06:00
icon.xcf updated docs 2022-01-03 16:45:58 -06:00
LICENSE initial commit 2021-07-12 13:26:46 -05:00
MANIFEST.in updated formatter and docs 2021-07-29 13:41:34 -05:00
package-lock.json chore(deps) Update all non-major dependencies 2023-02-13 10:10:34 +00:00
package.json chore(deps) Update all non-major dependencies 2023-02-13 10:10:34 +00:00
poetry.lock chore(deps) Update dependency black to v23 2023-02-06 15:18:36 +00:00
pyproject.toml chore(release): 1.19.14 [skip ci] 2023-02-07 19:44:15 +00:00
README.md fix(attributes): fixed outer quotes being stripped from attribute values 2022-12-15 10:46:39 -06:00
renovate.json updated renovate config 2022-07-18 08:56:53 -05:00
tox.ini tox.ini: Fix typo 2022-09-21 07:35:08 +02:00


djLint Logo

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

The missing formatter and linter for HTML templates.

tweet 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 with pip

pip 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

💙 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