diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2021-12-21 21:08:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-21 21:08:35 +0100 |
| commit | 56f68a1c29f0639da35aedefc5d7083f4c3da496 (patch) | |
| tree | d71b96230e3a0e2c9e7de87d84398684a7a20d3f /docs/conf.py | |
| parent | e869e3089cb5ed6ae7466086d5fe0505082dd954 (diff) | |
| parent | ca7f1a2da6e09a81a8823b1f146b186132ef0e92 (diff) | |
Merge pull request #632 from not-my-profile/module-column
[doc] engine-table: rename Engine column to Module & link
Diffstat (limited to 'docs/conf.py')
| -rw-r--r-- | docs/conf.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py index a319762e2..560e3daf8 100644 --- a/docs/conf.py +++ b/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 extlinks = {} |