From df0d0ecaabe1b9e3c1515c89da6f750bbf5d992b Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 20 Dec 2021 23:57:06 +0100 Subject: [PATCH] [doc] engine-table: sort by Disabled and Name --- docs/admin/engines/configured_engines.rst | 2 +- docs/conf.py | 3 +++ requirements-dev.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/admin/engines/configured_engines.rst b/docs/admin/engines/configured_engines.rst index 21bc0e92b..a36114488 100644 --- a/docs/admin/engines/configured_engines.rst +++ b/docs/admin/engines/configured_engines.rst @@ -37,7 +37,7 @@ Explanation of the :ref:`general engine configuration` shown in the table - Safe search - Time range - {% for name, mod in engines %} + {% for name, mod in engines | sort_engines %} * - `{{name}} <{{mod.about and mod.about.website}}>`_ - ``!{{mod.shortcut}}`` diff --git a/docs/conf.py b/docs/conf.py index 56f3e1d9f..d843a5a3f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,6 +49,9 @@ jinja_contexts = { }, }, } +jinja_filters = { + 'sort_engines': lambda engines: sorted(engines, key=lambda engine: (engine[1].disabled, engine[0])) +} # usage:: lorem :patch:`f373169` ipsum extlinks = {} diff --git a/requirements-dev.txt b/requirements-dev.txt index 97693d6b0..9556a302b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,7 +9,7 @@ twine==3.7.1 Pallets-Sphinx-Themes==2.0.2 Sphinx==4.3.1 sphinx-issues==1.2.0 -sphinx-jinja==1.1.1 +sphinx-jinja==1.2.1 sphinx-tabs==3.2.0 sphinxcontrib-programoutput==0.17 sphinx-autobuild==2021.3.14