rtts / djhtml

Django/Jinja template indenter
GNU General Public License v3.0
582 stars 32 forks source link

Relative multi-line HTML elements #83

Closed JaapJoris closed 1 year ago

JaapJoris commented 1 year ago

Reintroduces "relative multi-line" indentation to DjHTML:

<long-html-tag
    attribute1="value"
    attribute2="value"
    attribute3="value"/>

However, this only happens when the tag name is followed by a newline. Otherwise, "absolute multi-line" indentation will be used:

<long-html-tag attribute1="value"
               attribute2="value"
               attribute3="value"/>

This is a good rule, but also the last rule I'm willing to add regarding multi-line indentation. Our users deserve a stable set of indentation principles, and this is it. No more bikeshedding.