Currently we have two kinds of user documentation:
* the about page[1] which is written in HTML and part of the web
application and can therefore link instance-specific pages
(like e.g. the preferences) via Jinja variables
* the Sphinx documentation[2] which is written in reStructuredText
and cannot link instance-specific pages since it doesn't know
which instance the user is using
The plan is to integrate the user documentation currently in Sphinx
into the application, so that it can also link instance specific pages.
We also want to enable the user documentation to be translated.
This commit implements the first step in this endeavor (see #722).
[1]: searx/templates/__common__/about.html
[2]: docs/user/ (currently served at https://docs.searxng.org/user/)
nodejs.ensure only sets up NVM if there isn't a system-wide
installation of Node that matches our NODE_MINIMUM_VERSION.
The ubuntu image in the CI comes with an up to date node version,
so pyright from .nvm_packages is never installed.
This commit fixes this by introducing a package.json file.
Since we currently have many type checking errors,
we for now only test with typeCheckingMode: off
which makes pyright only check files that contain a comment:
# pyright: basic
to enable basic type checking, or
# pyright: strict
to enable strict type checking.
To get in use of pyright type cheker in Emacs, a pyright installation [1] is
needed and in Emacs the lsp-pyright package has to be installed::
M-x package-install lsp-pyright
[1] https://github.com/Microsoft/pyright
[2] https://github.com/emacs-lsp/lsp-pyright
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch implements the command and Makefile target::
./manage test.pyright
make test.pyright
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Pyright [1] is in the nvm enviroment, may be you need to rebuild the nvm
environment and install nodejs in::
./manage nvm.clean
./manage nvm.nodejs
The last command installs nodejs and the packages from .nvm_packages.
You can test your pyright installation, to get a bash within the nvm run::
./manage nvm.bash
(nvm) $ which pyright
./.nvm/versions/node/v16.13.0/bin/pyright
If you have a local nvm in your HOME folder, the output from ``which`` is
different. Press ``[CTRL-D]`` to get out of this bash.
[1] https://github.com/microsoft/pyright
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Without specifying folders to check, pyright will also scan files in folders
like ./build, ./cache, ./.nvm and more.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
By adding this file Pyright automatically detects the
packages from our Python virtual environment.
This can be tested by using the Pyright extension
for VS Code or by running npx pyright.
Since https://github.com/searxng/searxng/pull/354
the searx.network.stream(...) returns a tuple
This commits update the checker code according to
this function signature change.
With Sphinx-doc update 4.4.0 we get some warnings about links that can be
replaced by already defined 'sphinx.ext.extlinks':
admin/engines/sql-engines.rst:144: WARNING: hardcoded link 'https://pypi.org/project/mysql-connector-python' could be replaced by an extlink (try using ':pypi:`mysql-connector-python`' instead)
docs/admin/installation-switch2ng.rst:10: WARNING: hardcoded link 'https://github.com/searxng/searxng/pull/446#issuecomment-954730358' could be replaced by an extlink (try using ':pull:`446#issuecomment-954730358`' instead)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
$ make test.shell
./manage line 716:
build_msg TEST "[reST markup] ${RST_FILES[@]}""
^-------------^ SC2145: Argument mixes string and array. Use * or separate argument.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
webapp.py monkey-patches the Flask request global.
This commit adds a type cast so that e.g. Pyright[1]
doesn't show "Cannot access member" errors everywhere.
[1]: https://github.com/microsoft/pyright