From 532680be674bb64ee103bb6739a436687c717ad8 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 31 Jan 2022 14:06:22 +0100 Subject: [PATCH] [help] convert search_syntax.rst to help page --- docs/user/search_syntax.rst | 39 ---------------------------------- searx/help/en/search-syntax.md | 31 +++++++++++++++++++++++++++ searx/user_help.py | 6 +++++- 3 files changed, 36 insertions(+), 40 deletions(-) delete mode 100644 docs/user/search_syntax.rst create mode 100644 searx/help/en/search-syntax.md diff --git a/docs/user/search_syntax.rst b/docs/user/search_syntax.rst deleted file mode 100644 index 346b3162d..000000000 --- a/docs/user/search_syntax.rst +++ /dev/null @@ -1,39 +0,0 @@ - -.. _search-syntax: - -============= -Search syntax -============= - -SearXNG allows you to modify the default categories, engines and search language -via the search query. - -Prefix ``!`` - to set Category/engine - -Prefix: ``:`` - to set language - -Abbrevations of the engines and languages are also accepted. Engine/category -modifiers are chainable and inclusive (e.g. with :search:`!it !ddg !wp qwer -` search in IT category **and** duckduckgo -**and** wikipedia for ``qwer``). - -See the :search:`/preferences page ` for the list of engines, -categories and languages. - -Examples -======== - -Search in wikipedia for ``qwer``: - -- :search:`!wp qwer ` or -- :search:`!wikipedia qwer :search:` - -Image search: - -- :search:`!images Cthulhu ` - -Custom language in wikipedia: - -- :search:`:hu !wp hackerspace ` diff --git a/searx/help/en/search-syntax.md b/searx/help/en/search-syntax.md new file mode 100644 index 000000000..43ed673f6 --- /dev/null +++ b/searx/help/en/search-syntax.md @@ -0,0 +1,31 @@ +# Search syntax + +SearXNG allows you to modify the default categories, engines and search language +via the search query. + +Prefix `!` to set Category/engine. + +Prefix: `:` to set the language. + +Abbrevations of the engines and languages are also accepted. Engine/category +modifiers are chainable and inclusive (e.g. with [!it !ddg !wp +qwer]($search?q=!it+!ddg+!wp+qwer)) search in IT category **and** duckduckgo +**and** wikipedia for ``qwer``). + +See the [preferences]($preferences) for the list of engines, +categories and languages. + +## Examples + +Search in wikipedia for `qwer`: + +* [!wp qwer]($search?q=!wp+qwer) +* [!wikipedia qwer]($search?q=!wikipedia+qwer) + +Image search: + +* [!images Cthulu]($search?q=!images+Cthulu) + +Custom language in wikipedia: + +* [:hu !wp hackerspace]($search?q=:hu+!wp+hackerspace) diff --git a/searx/user_help.py b/searx/user_help.py index 446c52ca8..251e14462 100644 --- a/searx/user_help.py +++ b/searx/user_help.py @@ -18,7 +18,10 @@ class HelpPage(NamedTuple): # Whenever a new .md file is added to help/ it needs to be added here -_TOC = ('about',) +_TOC = ( + 'about', + 'search-syntax', +) PAGES: Dict[str, HelpPage] = {} """ Maps a filename under help/ without the file extension to the rendered page. """ @@ -49,6 +52,7 @@ def render(app: flask.Flask): variables['index'] = url_for('index') variables['preferences'] = url_for('preferences') variables['stats'] = url_for('stats') + variables['search'] = url_for('search') for pagename in _TOC: filename = 'help/en/' + pagename + '.md'