2021-07-29 19:52:55 +00:00
|
|
|

|
2021-07-29 19:12:14 +00:00
|
|
|
|
2021-09-08 08:46:40 +00:00
|
|
|
Find common formatting issues and *reformat* HTML templates.
|
|
|
|
|
|
2021-09-20 09:33:23 +00:00
|
|
|
***[Django](https://django.readthedocs.io/en/stable/ref/templates/language.html) · [Jinja](https://jinja2docs.readthedocs.io/en/stable/) · [Nunjucks](https://mozilla.github.io/nunjucks/) · [Handlebars](https://handlebarsjs.com)***
|
2021-09-08 08:46:40 +00:00
|
|
|
|
2021-09-08 09:29:43 +00:00
|
|
|
Ps, ``--check`` it out on other templates as well!
|
2021-07-29 19:12:14 +00:00
|
|
|
|
2021-09-08 08:46:40 +00:00
|
|
|
[](https://codecov.io/gh/Riverside-Healthcare/djlint) [](https://github.com/Riverside-Healthcare/djlint/actions/workflows/test.yml) [](https://www.codacy.com/gh/Riverside-Healthcare/djlint/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Riverside-Healthcare/djlint&utm_campaign=Badge_Grade) [](https://codeclimate.com/github/Riverside-Healthcare/djlint/maintainability) [](https://pepy.tech/project/djlint)[](https://discord.gg/taghAqebzU)
|
2021-07-29 19:12:14 +00:00
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
|
|
Read the [documentation](https://djlint.readthedocs.io)
|
|
|
|
|
|
2021-07-30 13:56:31 +00:00
|
|
|
## Installation and Usage
|
|
|
|
|
|
2021-09-08 08:46:40 +00:00
|
|
|
**djLint** can be installed with `pip install djlint`, and is easy to run:
|
2021-07-30 13:56:31 +00:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
# to lint a directory
|
|
|
|
|
djlint /path
|
|
|
|
|
|
|
|
|
|
# to lint a directory with custom extension
|
|
|
|
|
djlint /path -e html.dj
|
|
|
|
|
|
|
|
|
|
# to check formatting on a file
|
|
|
|
|
djlint /path/file.html.j2 --check
|
|
|
|
|
|
|
|
|
|
# to reformt a directory without printing the file diff
|
|
|
|
|
djlint /path --reformat --quiet
|
|
|
|
|
|
2021-09-16 11:36:44 +00:00
|
|
|
# using stdin
|
|
|
|
|
echo "<div></div>" | djlint -
|
|
|
|
|
|
2021-07-30 13:56:31 +00:00
|
|
|
```
|
|
|
|
|
|
2021-07-29 19:12:14 +00:00
|
|
|
## Show your format
|
|
|
|
|
|
|
|
|
|
Add a badge to your projects ```readme.md```:
|
|
|
|
|
|
|
|
|
|
```md
|
2021-09-08 08:46:40 +00:00
|
|
|
[](https://github.com/Riverside-Healthcare/djlint)
|
2021-07-29 19:12:14 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Add a badge to your ```readme.rst```:
|
|
|
|
|
|
|
|
|
|
```rst
|
|
|
|
|
.. image:: https://img.shields.io/badge/html%20style-djlint-blue.svg
|
|
|
|
|
:target: https://github.com/Riverside-Healthcare/djlint
|
|
|
|
|
```
|
|
|
|
|
Looks like this:
|
|
|
|
|
|
|
|
|
|
[](https://github.com/Riverside-Healthcare/djlint)
|
|
|
|
|
|
|
|
|
|
|
2021-09-08 08:46:40 +00:00
|
|
|
## Contributing
|
2021-07-29 19:12:14 +00:00
|
|
|
|
2021-09-08 08:46:40 +00:00
|
|
|
Checkout the [issue](https://github.com/Riverside-Healthcare/djlint/issues) list and help where you can.
|