on master help sign in
[mod] documentation: change the jinja context doesn't depend on searx.webapp

Before this commit, in the documentation, the jinja context is 'webapp' and contains the global variable in the searx.webapp module. This commit changes this to include only the mandatory variables to build the documentation.

commiteb1b5289d5da742473dd412e83abe35406da5fa5 authorAlexandre Flament <alex@al-f.net> dateMon 21 Dec 2020, 09:53 (6 years ago) parent1ba53e6
4 files changed+21−9
docs/admin/engines.rst+1−1 docs/admin/plugins.rst+1−1 docs/conf.py+8−2 docs/dev/reST.rst+11−5
docs/admin/engines.rst+1−1
@@ -46,7 +46,7 @@ Show errors **DE**
4646
4747.. _configured engines:
4848
49−.. jinja:: webapp
49+.. jinja:: searx
5050
5151 .. flat-table:: Engines configured at built time (defaults)
5252 :header-rows: 1
docs/admin/plugins.rst+1−1
@@ -14,7 +14,7 @@ Configuration defaults (at built time):
1414
1515.. _configured plugins:
1616
17−.. jinja:: webapp
17+.. jinja:: searx
1818
1919 .. flat-table:: Plugins configured at built time (defaults)
2020 :header-rows: 1
docs/conf.py+8−2
@@ -27,9 +27,15 @@ numfig = True
2727
2828exclude_patterns = ['build-templates/*.rst']
2929
30−from searx import webapp
30+import searx.search
31+import searx.engines
32+import searx.plugins
33+searx.search.initialize()
3134jinja_contexts = {
32− 'webapp': dict(**webapp.__dict__),
35+ 'searx': {
36+ 'engines': searx.engines.engines,
37+ 'plugins': searx.plugins.plugins
38+ },
3339}
3440
3541# usage:: lorem :patch:`f373169` ipsum
docs/dev/reST.rst+11−5
@@ -1289,15 +1289,21 @@ build chapter: :ref:`engines generic`. Below the jinja directive from the
12891289 :language: reST
12901290 :start-after: .. _configured engines:
12911291
1292−The context for the template is selected in the line ``.. jinja:: webapp``. In
1293−sphinx's build configuration (:origin:`docs/conf.py`) the ``webapp`` context
1294−points to the name space of the python module: ``webapp``.
1292+The context for the template is selected in the line ``.. jinja:: searx``. In
1293+sphinx's build configuration (:origin:`docs/conf.py`) the ``searx`` context
1294+contains the ``engines`` and ``plugins``.
12951295
12961296.. code:: py
12971297
1298− from searx import webapp
1298+ import searx.search
1299+ import searx.engines
1300+ import searx.plugins
1301+ searx.search.initialize()
12991302 jinja_contexts = {
1300− 'webapp': dict(**webapp.__dict__)
1303+ 'searx': {
1304+ 'engines': searx.engines.engines,
1305+ 'plugins': searx.plugins.plugins
1306+ },
13011307 }
13021308
13031309