Closed christophehenry closed 1 month ago
Deliberately out of scope, per README. Parsing HTML correctly is very complicated - for example, lots of things are optional. Combining this with parsing the meaning and potential output of template tags is near impossible. Other template formatters like djlint and DjHTML can introduce issues that break the meaning of templates, which is why I no longer recommend them.
I'm not saying never, but I am saying I have zero energy to look into this right now and having a large issue tracking ideas is not inspiring. You're free to experiment with extending Djade in this direction, though.
Description
Unless I'm wring, Djade currently only enforces Django template rules. I think it'd be nice if it proposed an HTML formatter too. I'd propose the following rules:
.editorconfig
, defaulting topyproject.toml
, defaulting to 120,.editorconfig
, defaulting topyproject.toml
, defaulting to 4 spaces,<img src="…" />
, not<img src="…"/>
or<img src="…">
href
,method
,action
(maybe configurable?)id
class
data-*
attributes, alphabetically ordered (maybe configurable?)