From 20a7b42d787c74f441b3f6ede44b7b77f54a5336 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 19 Jun 2024 20:56:12 -0700 Subject: [PATCH] Alternatives for Django template formatting --- npm/prettier-django.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/npm/prettier-django.md b/npm/prettier-django.md index d24610741..0feba2de0 100644 --- a/npm/prettier-django.md +++ b/npm/prettier-django.md @@ -58,3 +58,10 @@ Now I can run that command from anywhere on my computer: ```bash prettier-templates.sh templates/team_backups.html ``` + +## Alternatives + +Jeff Triplett [pointed me](https://mastodon.social/@webology/112646633489421925) to two pure Python alternatives: + +- [curlylint](https://curlylint.org) is "experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid" - `pip install curlylint` then `curlylint my/templates` +- [DjHTML](https://github.com/rtts/djhtml) is "a pure-Python Django/Jinja template indenter without dependencies" - `pip install djhtml` then `djhtml template.html`