Repository: BoboTiG/ebook-reader-dict

Issue:
Move etymology at the bottom
As per #1846 poll, move the etymology after definitions.

<!-- POLAR PLEDGE BADGE START -->
## Upvote & Fund

- We're using [Polar.sh](https://polar.sh/tiger-222) so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/BoboTiG/ebook-reader-dict/issues/2009">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/BoboTiG/ebook-reader-dict/issues/2009/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/BoboTiG/ebook-reader-dict/issues/2009/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->


Discussion:

Patch:
diff --git a/wikidict/__main__.py b/wikidict/__main__.py
index 16d992c0..6af1ea32 100644
--- a/wikidict/__main__.py
+++ b/wikidict/__main__.py
@@ -25,6 +25,7 @@
                                 - "data/$LOCALE/dicthtml-$LOCALE-$LOCALE.zip": Kobo format.
                                 - "data/$LOCALE/dict-$LOCALE-$LOCALE.df.bz2": DictFile format.
                                 - "data/$LOCALE/dict-$LOCALE-$LOCALE.zip": StarDict format.
+                                - "data/$LOCALE/dictorg-$LOCALE-$LOCALE.zip": DICT.org format.
   --find-templates          DEBUG: Find all templates in use.
   --check-words             Render words, then compare with the rendering done on the Wiktionary to catch errors.
                             --random            Randomly if --random
diff --git a/wikidict/convert.py b/wikidict/convert.py
index 0cb10c6c..8b3b2dec 100644
--- a/wikidict/convert.py
+++ b/wikidict/convert.py
@@ -39,20 +39,6 @@
         <a name="{{ word }}"/><b>{{ current_word }}</b>{{ pronunciation }}{{ gender }}
         <br/>
         <br/>
-        {% if etymologies %}
-            {% for etymology in etymologies %}
-                {% if etymology is string %}
-                    <p>{{ etymology }}</p>
-                {% else %}
-                    <ol>
-                        {% for sub_etymology in etymology %}
-                            <li>{{ sub_etymology }}</li>
-                        {% endfor %}
-                    </ol>
-                {% endif %}
-            {% endfor %}
-            <br/>
-        {% endif %}
         <ol>
             {% for definition in definitions %}
                 {% if definition is string %}
@@ -74,6 +60,19 @@
                 {% endif %}
             {% endfor %}
         </ol>
+        {% if etymologies %}
+            {% for etymology in etymologies %}
+                {% if etymology is string %}
+                    <p>{{ etymology }}</p>
+                {% else %}
+                    <ol>
+                        {% for sub_etymology in etymology %}
+                            <li>{{ sub_etymology }}</li>
+                        {% endfor %}
+                    </ol>
+                {% endif %}
+            {% endfor %}
+        {% endif %}
     </p>
     {% if variants %}
         {{ variants }}
@@ -92,22 +91,7 @@
 {%- for variant in variants %}
 & {{ variant }}
 {%- endfor %}
-<html>
-{%- if etymologies -%}
-    {%- for etymology in etymologies -%}
-        {%- if etymology is string -%}
-            <p>{{ etymology }}</p>
-        {%- else -%}
-            <ol>
-                {%- for sub_etymology in etymology -%}
-                    <li>{{ sub_etymology }}</li>
-                {%- endfor -%}
-            </ol>
-        {%- endif -%}
-    {%- endfor -%}
-    <br/>
-{%- endif -%}
-<ol>
+<html><ol>
     {%- for definition in definitions -%}
         {%- if definition is string -%}
             <li>{{ definition }}</li>
@@ -127,7 +111,20 @@
             </ol>
         {%- endif -%}
     {%- endfor -%}
-</ol></html>
+</ol>
+{%- if etymologies -%}
+    {%- for etymology in etymologies -%}
+        {%- if etymology is string -%}
+            <p>{{ etymology }}</p>
+        {%- else -%}
+            <ol>
+                {%- for sub_etymology in etymology -%}
+                    <li>{{ sub_etymology }}</li>
+                {%- endfor -%}
+            </ol>
+        {%- endif -%}
+    {%- endfor -%}
+{%- endif -%}</html>
 """
 )
 


Test patch:
diff --git a/tests/test_3_convert.py b/tests/test_3_convert.py
index 962c8a5d..eba6419c 100644
--- a/tests/test_3_convert.py
+++ b/tests/test_3_convert.py
@@ -216,7 +216,7 @@ def test_generate_secondary_dict(formatter: type[convert.BaseFormat], filename:
 
 
 FORMATTED_WORD_KOBO = """\
-<w><p><a name="Multiple Etymologies"/><b>Multiple Etymologies</b> pron <i>gender</i>.<br/><br/><p>etyl 1</p><ol><li>setyl 1</li></ol><br/><ol><li>def 1</li><ol style="list-style-type:lower-alpha"><li>sdef 1</li></ol></ol></p><var><variant name="multiple etymology"/></var></w>
+<w><p><a name="Multiple Etymologies"/><b>Multiple Etymologies</b> pron <i>gender</i>.<br/><br/><ol><li>def 1</li><ol style="list-style-type:lower-alpha"><li>sdef 1</li></ol></ol><p>etyl 1</p><ol><li>setyl 1</li></ol></p><var><variant name="multiple etymology"/></var></w>
 """
 FORMATTED_WORD_KOBO_NO_ETYMOLOGY = """\
 <w><p><a name="Multiple Etymologies"/><b>Multiple Etymologies</b> pron <i>gender</i>.<br/><br/><ol><li>def 1</li><ol style="list-style-type:lower-alpha"><li>sdef 1</li></ol></ol></p><var><variant name="multiple etymology"/></var></w>
@@ -225,7 +225,7 @@ def test_generate_secondary_dict(formatter: type[convert.BaseFormat], filename:
 @ Multiple Etymologies
 :  pron  <i>gender</i>.
 & Multiple Etymology
-<html><p>etyl 1</p><ol><li>setyl 1</li></ol><br/><ol><li>def 1</li><ol style="list-style-type:lower-alpha"><li>sdef 1</li></ol></ol></html>\
+<html><ol><li>def 1</li><ol style="list-style-type:lower-alpha"><li>sdef 1</li></ol></ol><p>etyl 1</p><ol><li>setyl 1</li></ol></html>\
 
 
 """