Reputation: 288
Where can I find a code formatter that reformats this template:
{% block content %}
{{ data|json_script:"data" }}
<div id="app">
<app></app>
</div>
{% render_bundle 'chunk-vendors' %}
{% render_bundle 'vue-dashboard' %}
{% endblock %
to this format (notice the indentation):
{% block content %}
{{ data|json_script:"data" }}
<div id="app">
<app></app>
</div>
{% render_bundle 'chunk-vendors' %}
{% render_bundle 'vue-dashboard' %}
{% endblock %}
I've used PyCharm to do it, but I'm looking for a standalone tool.
Upvotes: 4
Views: 1038
Reputation: 530
I had the same question and couldn't find anything so started a tool called djLint, with can
Theres another one out there called djhtml as well, but it requires that you already have all the line breaks you need in your code.. while djLint can take a single line of sloppy html and add the needed line breaks.
Neither is a parser, so if you put in bad code, you will get bad code out :)
Upvotes: 2