HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
Find a file
2022-07-05 17:06:50 +01:00
.github updated template 2022-06-30 07:57:55 -05:00
bin fixed path name 2022-02-18 17:02:44 -06:00
docs docs(fontawesome): updated fontawesome to v6 2022-06-30 10:35:17 -05:00
src feat(new option): added option to attempt to keep blank lines in templates 2022-06-30 07:53:24 -05:00
tests feat(new option): added option to attempt to keep blank lines in templates 2022-06-30 07:53:24 -05:00
.coveragerc fixed test coverage 2021-08-17 08:56:40 -05:00
.editorconfig docs(edit button): added edit button the rest of the pages 2022-06-22 14:43:35 -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 use types for others 2022-07-05 17:06:50 +01:00
.releaserc ci(release): changed npm publish to bool 2022-04-25 09:06:14 -05: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 Merge branch 'dev' into renovate/npm-semantic-release-vulnerability 2022-06-16 13:41:08 -05:00
package.json chore(release): 1.3.0 [skip ci] 2022-06-30 13:09:25 +00:00
poetry.lock refactor(htlm tags): changed list of html tags to import list 2022-05-17 12:59:33 -05:00
pyproject.toml chore(release): 1.3.0 [skip ci] 2022-06-30 13:09:25 +00:00
README.md fix(curly hash comment): fix formatting on curly hash comment blocks 2022-06-21 07:13:44 -05:00
renovate.json docs(edit): added edit on github link 2022-06-22 10:03:18 -05:00
requirements.txt refactor(htlm tags): changed list of html tags to import list 2022-05-17 12:59:33 -05:00
setup.cfg test(restructured): restructured the tests 2022-05-13 15:36:55 -05:00
tox.ini test(restructured): restructured the tests 2022-05-13 15:36:55 -05:00


djLint Logo

🙏 Passed 100k downloads! Thank you! 🙏

The missing formatter and linter for HTML templates.

tweet Discord Chat

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

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