From 8ae1107529e33c13569badaaa94faf04352b8940 Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Sat, 6 Sep 2025 10:02:18 +0200 Subject: [PATCH] style: Add .editorconfig to ease editing & indentation in html --- .editorconfig | 12 ++ templates/anki/nonconforming.html.twig | 28 ++-- templates/base.html.twig | 140 +++++++++--------- templates/kanji/grid.html.twig | 185 +++++++++++++----------- templates/kanji/view.html.twig | 192 ++++++++++++------------- 5 files changed, 291 insertions(+), 266 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..be0b4e5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +end_of_line = lf +charset = utf-8 +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{html.twig,html}] +indent_size = 2 diff --git a/templates/anki/nonconforming.html.twig b/templates/anki/nonconforming.html.twig index db2c411..f901a7c 100644 --- a/templates/anki/nonconforming.html.twig +++ b/templates/anki/nonconforming.html.twig @@ -4,19 +4,19 @@ {% block body %}
-

hello

- total {{ notes|length }} - {% for note in notes %} -
- {{ note.fields.SentKanji }} -
- view -
- {% endfor %} +

hello

+ total {{ notes|length }} + {% for note in notes %} +
+ {{ note.fields.SentKanji }} +
+ view +
+ {% endfor %}
{% endblock %} diff --git a/templates/base.html.twig b/templates/base.html.twig index 2206b4d..2202e65 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,79 +1,79 @@ - - - {% block title %}Welcome!{% endblock %} - - {% block stylesheets %} - {% endblock %} + + + {% block title %}Welcome!{% endblock %} + + {% block stylesheets %} + {% endblock %} - {% block javascripts %} - {% block importmap %}{{ importmap('app') }}{% endblock %} - {% endblock %} - - - {% block body %}{% endblock %} + {% block javascripts %} + {% block importmap %}{{ importmap('app') }}{% endblock %} + {% endblock %} + + + {% block body %}{% endblock %} - + - {#
-
-
- Loading... -
-
Loading...
-
-
#} - - - - - + diff --git a/templates/kanji/grid.html.twig b/templates/kanji/grid.html.twig index 37c9c34..8efcb2c 100644 --- a/templates/kanji/grid.html.twig +++ b/templates/kanji/grid.html.twig @@ -4,101 +4,114 @@ {% block body %}
+

{{ block('title') }}

-
- {% for char in characters %} -
-
-
- {#{% if char.jiten_href != null %} - - {{- char.str -}} - - {% else %}#} - {{- char.str -}} - {#{% endif %}#} - -
-
- {% if char.lists.unicode is not defined %} - - {{ char.codepoint }} - - {% else %} - {{ char.codepoint }} - {% endif %} -
-
-
- {% endfor %} +
+
+
+
+ {% for char in characters %} +
+
+
+ {#{% if char.jiten_href != null %} + + {{- char.str -}} + + {% else %}#} + {{- char.str -}} + {#{% endif %}#} + +
+
+ {% if char.lists.unicode is not defined %} + + {{ char.codepoint }} + + {% else %} + {{ char.codepoint }} + {% endif %} +
+
+
+ {% endfor %} +
{% endblock %} diff --git a/templates/kanji/view.html.twig b/templates/kanji/view.html.twig index 20e223b..f7bc95b 100644 --- a/templates/kanji/view.html.twig +++ b/templates/kanji/view.html.twig @@ -1,100 +1,100 @@
-
-
-
-
{{ char }}
-
- -
-
-

Lists

-
    - {% for list in info|keys %} -
  • {{ list }}
  • - {% endfor %} -
-
-
-

Links

- -
+
+
+
+
{{ char }}
+
+
-
-

Appeareances

- {% for refname, refcount in ref %} -
{{ refname|basename }}: {{ refcount }}
- {% endfor %} +
+

Lists

+
    + {% for list in info|keys %} +
  • {{ list }}
  • + {% endfor %} +
+
+

Links

+ +
+
+
+

Appeareances

+ {% for refname, refcount in ref %} +
{{ refname|basename }}: {{ refcount }}
+ {% endfor %} +