Previously engines were defined in modules, which where then
stapled with logger, supported_languages & language_aliases
via monkey patching in searx/engines/__init__.py.
Monkey patching is obviously a bad practice since it confuses
humans as well as static type checkers. But there were more problems:
* there were no type hints for the method input and output types
* the request method did not even make a clear distinction between input
and output (abusing a single "params" dictionary for both)
This commit introduces a new class-based architecture for engines,
in a backwards-compatiable manner: allowing old-style module engines
to be used along witn new-style class-based engines.
Previously all categories were displayed as search engine tabs.
This commit changes that so that only the categories listed under
categories_as_tabs in settings.yml are displayed.
This lets us introduce more categories without cluttering up the UI.
Categories not displayed as tabs can still be searched with !bangs.
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.