Skip to content

Commit 510bfe0

Browse files
committed
Update README
1 parent b560343 commit 510bfe0

File tree

1 file changed

+13
-58
lines changed

1 file changed

+13
-58
lines changed

README.md

+13-58
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
***A pure-Python Django/Jinja template indenter without dependencies.***
44

5+
```jinja
6+
{% block content %}
7+
<blockquote
8+
cite="Guido Van Rossum"
9+
class="Pythonic"
10+
>
11+
{% blocktranslate trimmed %}
12+
Don't you hate code that's not properly indented?
13+
{% endblocktranslate %}
14+
</blockquote>
15+
{% endblock %}
16+
```
17+
518
DjHTML indents mixed HTML/CSS/JavaScript templates that contain
619
[Django](https://docs.djangoproject.com/en/stable/ref/templates/language/)
720
or [Jinja](https://jinja.palletsprojects.com/templates/) template
@@ -15,64 +28,6 @@ other characters. The goal is to correctly indent already
1528
well-structured templates, not to fix broken ones.
1629

1730

18-
### New! Multi-line HTML elements
19-
20-
As of version 3, DjHTML indents multi-line HTML elements and
21-
multi-line attribute values like this:
22-
23-
```jinja
24-
<blockquote cite="Guido Van Rossum"
25-
style="font-style: italic;
26-
{% if dark_mode %}
27-
background: black;
28-
{% endif %}
29-
">
30-
Don't you hate code that's not properly indented?
31-
</blockquote>
32-
```
33-
34-
35-
### New! Multi-line CSS indentation
36-
37-
Multi-line CSS values are now continued at the same indentation level:
38-
39-
```jinja
40-
<style>
41-
@font-face {
42-
font-family: Helvetica;
43-
src: {% for format, filename in licensed_fonts %}
44-
url('{% static filename %}') format('{{ format }}'),
45-
{% endfor %}
46-
url('Arial.woff2') format('woff2'),
47-
url('Arial.woff') format('woff');
48-
}
49-
</style>
50-
```
51-
52-
53-
### New! Improved JavaScript indentation
54-
55-
Many new JavaScript indention rules have been added, such as the
56-
indentation of method chaining:
57-
58-
```jinja
59-
<script>
60-
window.fetch('/test.html')
61-
.then((html) => {
62-
document.body.innerHTML = html;
63-
{% block extra_statements %}
64-
{% endblock %}
65-
});
66-
</script>
67-
```
68-
69-
70-
### New! Tabwidth guessing
71-
72-
Without the `-t` / `--tabwidth` argument, DjHTML no longer defaults to
73-
a tabwidth of 4 but instead guesses the correct tabwidth.
74-
75-
7631
## Installation
7732

7833
DjHTML requires Python 3.8 or higher and is compatible with all

0 commit comments

Comments
 (0)