Fix the search function in Sphinx generated html docs when built
with Sphinx >= 6.0.0.

Quote from the Sphinx blog at
https://blog.readthedocs.com/sphinx6-upgrade

Sphinx 6 is out and has important breaking changes

Bundled jQuery is removed. The JavaScript asset is easily added
back using the new extension sphinxcontrib-jquery. It is included
automatically by sphinx-rtd-theme, so if you are using our theme,
you will also continue to have jQuery available in your
documentation.

Signed-off-by: Volker Rümelin <vr_q...@t-online.de>
---
 docs/conf.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index 876f676881..2aedd407a0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -62,6 +62,9 @@
 # ones.
 extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'depfile', 'qapidoc']
 
+if sphinx.version_info[:3] >= (6, 0, 0):
+    extensions += ['sphinxcontrib.jquery']
+
 if sphinx.version_info[:3] > (4, 0, 0):
     tags.add('sphinx4')
     extensions += ['dbusdoc']
-- 
2.35.3


Reply via email to