forked from Ponysearch/Ponysearch
Merge pull request #632 from not-my-profile/module-column
[doc] engine-table: rename Engine column to Module & link
This commit is contained in:
commit
56f68a1c29
2 changed files with 25 additions and 2 deletions
|
@ -30,7 +30,7 @@ Explanation of the :ref:`general engine configuration` shown in the table
|
||||||
|
|
||||||
* - Name
|
* - Name
|
||||||
- Shortcut
|
- Shortcut
|
||||||
- Engine
|
- Module
|
||||||
- Disabled
|
- Disabled
|
||||||
- Timeout
|
- Timeout
|
||||||
- Weight
|
- Weight
|
||||||
|
@ -43,7 +43,11 @@ Explanation of the :ref:`general engine configuration` shown in the table
|
||||||
|
|
||||||
* - `{{name}} <{{mod.about and mod.about.website}}>`_
|
* - `{{name}} <{{mod.about and mod.about.website}}>`_
|
||||||
- ``!{{mod.shortcut}}``
|
- ``!{{mod.shortcut}}``
|
||||||
- {{mod.__name__}}
|
- {%- if 'searx.engines.' + mod.__name__ in documented_modules %}
|
||||||
|
:py:mod:`~searx.engines.{{mod.__name__}}`
|
||||||
|
{%- else %}
|
||||||
|
:origin:`{{mod.__name__}} <searx/engines/{{mod.__name__}}.py>`
|
||||||
|
{%- endif %}
|
||||||
- {{(mod.disabled and "y") or ""}}
|
- {{(mod.disabled and "y") or ""}}
|
||||||
{%- if mod.about and mod.about.language %}
|
{%- if mod.about and mod.about.language %}
|
||||||
({{mod.about.language | upper}})
|
({{mod.about.language | upper}})
|
||||||
|
|
19
docs/conf.py
19
docs/conf.py
|
@ -58,6 +58,25 @@ jinja_filters = {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Let the Jinja template in configured_engines.rst access documented_modules
|
||||||
|
# to automatically link documentation for modules if it exists.
|
||||||
|
def setup(app):
|
||||||
|
ENGINES_DOCNAME = 'admin/engines/configured_engines'
|
||||||
|
|
||||||
|
def before_read_docs(app, env, docnames):
|
||||||
|
assert ENGINES_DOCNAME in docnames
|
||||||
|
docnames.remove(ENGINES_DOCNAME)
|
||||||
|
docnames.append(ENGINES_DOCNAME)
|
||||||
|
# configured_engines must come last so that sphinx already has
|
||||||
|
# discovered the python module documentations
|
||||||
|
|
||||||
|
def source_read(app, docname, source):
|
||||||
|
if docname == ENGINES_DOCNAME:
|
||||||
|
jinja_contexts['searx']['documented_modules'] = app.env.domains['py'].modules
|
||||||
|
|
||||||
|
app.connect('env-before-read-docs', before_read_docs)
|
||||||
|
app.connect('source-read', source_read)
|
||||||
|
|
||||||
# usage:: lorem :patch:`f373169` ipsum
|
# usage:: lorem :patch:`f373169` ipsum
|
||||||
extlinks = {}
|
extlinks = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue