question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Django template syntax compatibility

See original GitHub issue

The mustache support is a really nice feature. It would be great if the HTML beautifier also understood (and indented where required) Django template syntax.

Given the following:

{% extends "foo.html" %}{% block bar %}
{% for  in zulu %}<li><a>zulu</a></li>{% endfor %}
{% endblock %}

I would expect the output to be:

{% extends "foo.html" %}
{% block bar %}
    {% for  in zulu %}
        <li>
            <a>zulu</a>
        </li>
    {% endfor %}
{% endblock %}

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:9
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bitwisemancommented, Jul 18, 2019

Django and related languages do not indent yet, but they are now supported in that they are not killed by beautification.

0reactions
bitwisemancommented, Aug 8, 2020

@AdrienLemaire @antnieszka @jkevingutierrez PRs welcome. If you look at what is don’t for mustache and build around it, it should be possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Built-in template tags and filters
Filters the contents of the block through one or more filters. Multiple filters can be specified with pipes and filters can have arguments,...
Read more >
Django Templates
A Django template is a text document or a Python string marked-up using the Django template language. Some constructs are recognized and ...
Read more >
Django template language how to fix
In your settings.py file, in the TEMPLATES-section, APP_DIRS is true, so you should create a directory 'stack' under your 'templates' directory ...
Read more >
How to use extends from Django template tags
A Django template is a text document, like HTML, that adds jinja syntax. The syntax of the Django template language involves four constructs, ......
Read more >
Django Tutorial Part 5: Creating our home page
In addition to template tags, the template syntax allows you to reference variables that are passed into the template from the view, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found