mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 12:10:11 +01:00
[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.
This commit is contained in:
parent
1ba53e6129
commit
eb1b5289d5
@ -46,7 +46,7 @@ Show errors **DE**
|
|||||||
|
|
||||||
.. _configured engines:
|
.. _configured engines:
|
||||||
|
|
||||||
.. jinja:: webapp
|
.. jinja:: searx
|
||||||
|
|
||||||
.. flat-table:: Engines configured at built time (defaults)
|
.. flat-table:: Engines configured at built time (defaults)
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
@ -14,7 +14,7 @@ Configuration defaults (at built time):
|
|||||||
|
|
||||||
.. _configured plugins:
|
.. _configured plugins:
|
||||||
|
|
||||||
.. jinja:: webapp
|
.. jinja:: searx
|
||||||
|
|
||||||
.. flat-table:: Plugins configured at built time (defaults)
|
.. flat-table:: Plugins configured at built time (defaults)
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
10
docs/conf.py
10
docs/conf.py
@ -27,9 +27,15 @@ numfig = True
|
|||||||
|
|
||||||
exclude_patterns = ['build-templates/*.rst']
|
exclude_patterns = ['build-templates/*.rst']
|
||||||
|
|
||||||
from searx import webapp
|
import searx.search
|
||||||
|
import searx.engines
|
||||||
|
import searx.plugins
|
||||||
|
searx.search.initialize()
|
||||||
jinja_contexts = {
|
jinja_contexts = {
|
||||||
'webapp': dict(**webapp.__dict__),
|
'searx': {
|
||||||
|
'engines': searx.engines.engines,
|
||||||
|
'plugins': searx.plugins.plugins
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# usage:: lorem :patch:`f373169` ipsum
|
# usage:: lorem :patch:`f373169` ipsum
|
||||||
|
@ -1289,15 +1289,21 @@ build chapter: :ref:`engines generic`. Below the jinja directive from the
|
|||||||
:language: reST
|
:language: reST
|
||||||
:start-after: .. _configured engines:
|
:start-after: .. _configured engines:
|
||||||
|
|
||||||
The context for the template is selected in the line ``.. jinja:: webapp``. In
|
The context for the template is selected in the line ``.. jinja:: searx``. In
|
||||||
sphinx's build configuration (:origin:`docs/conf.py`) the ``webapp`` context
|
sphinx's build configuration (:origin:`docs/conf.py`) the ``searx`` context
|
||||||
points to the name space of the python module: ``webapp``.
|
contains the ``engines`` and ``plugins``.
|
||||||
|
|
||||||
.. code:: py
|
.. code:: py
|
||||||
|
|
||||||
from searx import webapp
|
import searx.search
|
||||||
|
import searx.engines
|
||||||
|
import searx.plugins
|
||||||
|
searx.search.initialize()
|
||||||
jinja_contexts = {
|
jinja_contexts = {
|
||||||
'webapp': dict(**webapp.__dict__)
|
'searx': {
|
||||||
|
'engines': searx.engines.engines,
|
||||||
|
'plugins': searx.plugins.plugins
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user