İçeriğe geç

HTML şablonlarını denetleyin ve biçimlendirin

Genel HTML araçları {% %} ve {{ }} yapılarını ayrıştıramaz, şablon motorları da çevrelerindeki işaretlemenin nasıl göründüğüyle ilgilenmez. djLint, şablon sözdizimiyle dolu HTML'i yeniden biçimlendirir ve yaygın hatalara karşı denetler. Django, Jinja, Twig, Nunjucks, Handlebars, Liquid, Go şablonları ve daha fazlası için profiller sunar. Komut satırından, pre-commit kancası olarak ve düzenleyicinizde dil sunucusu olarak çalışır.

uv tool install djlint
pip install djlint
npm i -g djlint

messy.html10 sorunSorun yok
{% block content %}<SECTION H009 Tag names should be lowercase. class='posts' H008 Attributes should be double quoted.> H014 Found extra blank lines.<h2>Latest posts</h2>{%if posts%} T001 Variables should be wrapped in a whitespace.<ul>{% for post in posts %}<li><a href="{% url 'post' post.slug %}" class='post-link' H008 Attributes should be double quoted. aria-label="Read {{post.title}}" T001 Variables should be wrapped in a whitespace.>{{post.title}} T001 Variables should be wrapped in a whitespace.</a></li>{% endfor %}</ul>{%else%} T001 Variables should be wrapped in a whitespace.<p>No posts yet.</p>{%endif%} T001 Variables should be wrapped in a whitespace.</SECTION H009 Tag names should be lowercase.>{% endblock %}
{% block content %}    <section class="posts">        <h2>Latest posts</h2>        {% if posts %}            <ul>                {% for post in posts %}                    <li>                        <a href="{% url 'post' post.slug %}"                           class="post-link"                           aria-label="Read {{ post.title }}">{{ post.title }}</a>                    </li>                {% endfor %}            </ul>        {% else %}            <p>No posts yet.</p>        {% endif %}    </section>{% endblock %}
{% block content %}    <section class="posts">        <h2>Latest posts</h2>        {% if posts %}            <ul>                {% for post in posts %}                    <li>                        <a                            href="{% url 'post' post.slug %}"                            class="post-link"                            aria-label="Read {{ post.title }}"                        >{{ post.title }}</a>                    </li>                {% endfor %}            </ul>        {% else %}            <p>No posts yet.</p>        {% endif %}    </section>{% endblock %}
djlint messy.html --reformat

Şablon diliniz için bir profil

Rozet

Şöyle görünür:html style: djLint

Projelerinize bir rozet ekleyin:

[![html style: djLint](https://img.shields.io/badge/html%20style-djLint-blue.svg)](https://djlint.com)

Katkıda bulunma

Katkılara açığız. Üzerinde çalışmak için bir issue seçin ya da bir düzeltme veya yeni bir özellik içeren bir pull request açın.

GitHub

djLint'i Christopher Pickering, Atlas projeleri için geliştirdi. Bugün monosans ve katkıda bulunan herkes tarafından sürdürülüyor.