Xzya / django-web-components

A simple way to create reusable template components in Django.
MIT License
159 stars 4 forks source link

Indentation in VS code #18

Open lchen198 opened 3 months ago

lchen198 commented 3 months ago

Thanks for creating this library. It is super useful!

I noticed the indentation in VS code is not correct when I use Djlint to format the html file.

I ended up getting this:

          {% for coupon, own in ownership %}
            <div class="col">
              {% card %}
              {% slot buttons %}
         {% endslot  %}
      {% endcard%}
      </div>
   {% endfor %}

Is there a way to fix it?

lchen198 commented 3 months ago

The solution is to add a djlint setting in the pyproject.toml

[tool.djlint] custom_blocks="card,slot"

lchen198 commented 3 months ago

Could you please add this to the documentation. Thanks!