HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
Find a file
2022-04-05 15:08:29 +00:00
.github chore(deps) Update codecov/codecov-action action to v3 2022-04-05 15:08:29 +00:00
bin fixed path name 2022-02-18 17:02:44 -06:00
docs Merge pull request #207 from Riverside-Healthcare/renovate/pin-dependencies 2022-04-05 10:05:21 -05:00
src Merge pull request #198 from andersk/colorama-init 2022-03-18 12:53:00 -05:00
tests updated readme and docs 2022-03-30 10:03:44 -05:00
.coveragerc fixed test coverage 2021-08-17 08:56:40 -05:00
.gitignore updated release and gitignore 2022-01-03 16:50:21 -06:00
.pre-commit-config.yaml started npm installer 2022-02-18 17:01:16 -06:00
.pre-commit-hooks.yaml Make the repo a pre-commit hook. 2021-11-12 01:30:16 +00: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 removed unused dep 2022-02-18 17:07:00 -06:00
package.json updated version and changelog 2022-02-21 08:44:54 -06:00
poetry.lock chore(build): update packages [Weekly] 2022-02-13 01:13:38 +00:00
pyproject.toml closes #194, added test 2022-03-14 09:24:28 -05:00
README.md fixed link 2022-03-30 16:37:32 -05:00
renovate.json Update renovate.json 2022-04-05 09:57:44 -05:00
requirements.txt started npm installer 2022-02-18 17:01:16 -06:00
setup.cfg fixed #147, added tests 2021-11-26 13:06:05 +01:00
tox.ini updated docs 2022-01-03 16:45:58 -06:00


djLint Logo

The missing formatter and linter for HTML templates.

Codecov Status Test Status Codacy Status Maintainability Downloads Discord Chat 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

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]((https://github.com/Riverside-Healthcare/djLint/blob/master/src/djlint/rules.yaml)

⚠️ 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