forked from Ponysearch/Ponysearch
[doc] engine tables: show engines in all categories
Previously the documentation grouped the engines by their first category so e.g. YouTube and Invidious were only shown in the in the videos section but not in the music section. This commit fixes this by iterating over searx.engines.categories, which also has the added benefit that the sections are now in the same order as the tabs in the user interface.
This commit is contained in:
parent
d8af94b721
commit
02e9bdf755
2 changed files with 6 additions and 4 deletions
|
@ -16,7 +16,7 @@ Explanation of the :ref:`general engine configuration` shown in the table
|
||||||
|
|
||||||
SearXNG supports {{engines | length}} search engines (of which {{enabled_engine_count}} are enabled by default).
|
SearXNG supports {{engines | length}} search engines (of which {{enabled_engine_count}} are enabled by default).
|
||||||
|
|
||||||
{% for category, engines in engines.items() | groupby('1.categories.0') %}
|
{% for category, engines in categories.items() %}
|
||||||
|
|
||||||
{{category}} search engines
|
{{category}} search engines
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
@ -39,9 +39,9 @@ Explanation of the :ref:`general engine configuration` shown in the table
|
||||||
- Safe search
|
- Safe search
|
||||||
- Time range
|
- Time range
|
||||||
|
|
||||||
{% for name, mod in engines | sort_engines %}
|
{% for mod in engines | sort_engines %}
|
||||||
|
|
||||||
* - `{{name}} <{{mod.about and mod.about.website}}>`_
|
* - `{{mod.name}} <{{mod.about and mod.about.website}}>`_
|
||||||
- ``!{{mod.shortcut}}``
|
- ``!{{mod.shortcut}}``
|
||||||
- {%- if 'searx.engines.' + mod.__name__ in documented_modules %}
|
- {%- if 'searx.engines.' + mod.__name__ in documented_modules %}
|
||||||
:py:mod:`~searx.engines.{{mod.__name__}}`
|
:py:mod:`~searx.engines.{{mod.__name__}}`
|
||||||
|
|
|
@ -40,6 +40,7 @@ exclude_patterns = ['build-templates/*.rst']
|
||||||
import searx.engines
|
import searx.engines
|
||||||
import searx.plugins
|
import searx.plugins
|
||||||
searx.engines.load_engines(searx.settings['engines'])
|
searx.engines.load_engines(searx.settings['engines'])
|
||||||
|
|
||||||
jinja_contexts = {
|
jinja_contexts = {
|
||||||
'searx': {
|
'searx': {
|
||||||
'engines': searx.engines.engines,
|
'engines': searx.engines.engines,
|
||||||
|
@ -48,13 +49,14 @@ jinja_contexts = {
|
||||||
'node': os.getenv('NODE_MINIMUM_VERSION')
|
'node': os.getenv('NODE_MINIMUM_VERSION')
|
||||||
},
|
},
|
||||||
'enabled_engine_count': sum(not x.disabled for x in searx.engines.engines.values()),
|
'enabled_engine_count': sum(not x.disabled for x in searx.engines.engines.values()),
|
||||||
|
'categories': searx.engines.categories,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
jinja_filters = {
|
jinja_filters = {
|
||||||
'sort_engines':
|
'sort_engines':
|
||||||
lambda engines: sorted(
|
lambda engines: sorted(
|
||||||
engines,
|
engines,
|
||||||
key=lambda engine: (engine[1].about.get('language', ''), engine[0])
|
key=lambda engine: (engine.about.get('language', ''), engine.name)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue