[doc] introduce about.language and sort engines by it

This commit is contained in:
Martin Fischer 2021-12-21 09:39:03 +01:00
parent 3c0f01aed7
commit e28c6bda35
8 changed files with 19 additions and 1 deletions

View file

@ -43,6 +43,9 @@ Explanation of the :ref:`general engine configuration` shown in the table
- ``!{{mod.shortcut}}``
- {{mod.__name__}}
- {{(mod.disabled and "y") or ""}}
{%- if mod.about and mod.about.language %}
({{mod.about.language | upper}})
{%- endif %}
- {{mod.timeout}}
- {{mod.weight or 1 }}
{% if mod.engine_type == 'online' %}

View file

@ -50,7 +50,11 @@ jinja_contexts = {
},
}
jinja_filters = {
'sort_engines': lambda engines: sorted(engines, key=lambda engine: (engine[1].disabled, engine[0]))
'sort_engines':
lambda engines: sorted(
engines,
key=lambda engine: (engine[1].disabled, engine[1].about.get('language', ''), engine[0])
)
}
# usage:: lorem :patch:`f373169` ipsum