diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/admin/engines/configured_engines.rst | 14 | ||||
| -rw-r--r-- | docs/admin/engines/settings.rst | 22 | ||||
| -rw-r--r-- | docs/conf.py | 10 | ||||
| -rw-r--r-- | docs/user/search_syntax.rst | 3 |
4 files changed, 37 insertions, 12 deletions
diff --git a/docs/admin/engines/configured_engines.rst b/docs/admin/engines/configured_engines.rst index 0060d1b74..c7b6a1f52 100644 --- a/docs/admin/engines/configured_engines.rst +++ b/docs/admin/engines/configured_engines.rst @@ -16,11 +16,18 @@ 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). - {% for category, engines in engines.items() | groupby('1.categories.0') %} + {% for category, engines in categories_as_tabs.items() %} {{category}} search engines --------------------------------------- + {% for group, engines in engines | group_engines_in_tab %} + + {% if loop.length > 1 %} + {{group}} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + {% endif %} + .. flat-table:: :header-rows: 2 :stub-columns: 1 @@ -39,9 +46,9 @@ Explanation of the :ref:`general engine configuration` shown in the table - Safe search - Time range - {% for name, mod in engines | sort_engines %} + {% for mod in engines %} - * - `{{name}} <{{mod.about and mod.about.website}}>`_ + * - `{{mod.name}} <{{mod.about and mod.about.website}}>`_ - ``!{{mod.shortcut}}`` - {%- if 'searx.engines.' + mod.__name__ in documented_modules %} :py:mod:`~searx.engines.{{mod.__name__}}` @@ -65,3 +72,4 @@ Explanation of the :ref:`general engine configuration` shown in the table {% endfor %} {% endfor %} + {% endfor %} diff --git a/docs/admin/engines/settings.rst b/docs/admin/engines/settings.rst index bcf0c6bb3..a829b870c 100644 --- a/docs/admin/engines/settings.rst +++ b/docs/admin/engines/settings.rst @@ -222,6 +222,26 @@ Communication with search engines. ``max_redirects`` : 30 by default. Maximum redirect before it is an error. +``categories_as_tabs:`` +----------------------- + +A list of the categories that are displayed as tabs in the user interface. +Categories not listed here can still be searched with the :ref:`search-syntax`. + +.. code-block:: yaml + + categories_as_tabs: + general: + images: + videos: + news: + map: + music: + it: + science: + files: + social media: + .. _settings engine: Engine settings @@ -282,7 +302,7 @@ engine is shown. Most of the options have a default value or even are optional. search engine. ``shortcut`` : - Code used to execute bang requests (in this case using ``!bi`` or ``?bi``) + Code used to execute bang requests (in this case using ``!bi``) ``base_url`` : optional Part of the URL that should be stable across every request. Can be useful to diff --git a/docs/conf.py b/docs/conf.py index 628687b6a..62b541f2f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -39,7 +39,9 @@ exclude_patterns = ['build-templates/*.rst'] import searx.engines import searx.plugins +import searx.webutils searx.engines.load_engines(searx.settings['engines']) + jinja_contexts = { 'searx': { 'engines': searx.engines.engines, @@ -48,14 +50,12 @@ jinja_contexts = { 'node': os.getenv('NODE_MINIMUM_VERSION') }, 'enabled_engine_count': sum(not x.disabled for x in searx.engines.engines.values()), + 'categories': searx.engines.categories, + 'categories_as_tabs': {c: searx.engines.categories[c] for c in searx.settings['categories_as_tabs']}, }, } jinja_filters = { - 'sort_engines': - lambda engines: sorted( - engines, - key=lambda engine: (engine[1].disabled, engine[1].about.get('language', ''), engine[0]) - ) + 'group_engines_in_tab': searx.webutils.group_engines_in_tab, } # Let the Jinja template in configured_engines.rst access documented_modules diff --git a/docs/user/search_syntax.rst b/docs/user/search_syntax.rst index 50cd8fabb..e9ed3e870 100644 --- a/docs/user/search_syntax.rst +++ b/docs/user/search_syntax.rst @@ -14,9 +14,6 @@ Prefix ``!`` Prefix: ``:`` to set language -Prefix: ``?`` - to add engines and categories to the currently selected categories - Abbrevations of the engines and languages are also accepted. Engine/category modifiers are chainable and inclusive (e.g. with :search:`!it !ddg !wp qwer <?q=%21it%20%21ddg%20%21wp%20qwer>` search in IT category **and** duckduckgo |