]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc: add in-doc search from read the docs 38302/head
authorKefu Chai <kchai@redhat.com>
Thu, 9 Apr 2020 15:14:42 +0000 (23:14 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 26 Nov 2020 09:34:06 +0000 (17:34 +0800)
readthedocs-sphinx-search features better user experience than the
builtin search offered by sphinx

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 8bd8a8badbf992347a0883a537cce414432c867e)

admin/doc-read-the-docs.txt
doc/conf.py

index bcc77ccffb0a3553f7b3a2a8b101e6a3468cd7e4..b65cc4638491a583db59c7aeb0d5f8c3cfbfbee1 100644 (file)
@@ -1 +1,2 @@
 plantweb
+git+https://github.com/readthedocs/readthedocs-sphinx-search@master
index 74d8417046ec1527248545ffd5ff9f3a9cdf8fcd..5c58d4bc60a55d4d1124d6b730461539e2973779 100644 (file)
@@ -51,6 +51,7 @@ extensions = [
     'breathe',
     'edit_on_github',
     ]
+
 ditaa = shutil.which("ditaa")
 if ditaa is not None:
     extensions += ['sphinxcontrib.ditaa']
@@ -60,6 +61,10 @@ else:
         'engine': 'ditaa'
     }
 
+build_with_rtd = os.environ.get('READTHEDOCS') == 'True'
+if build_with_rtd:
+    extensions += ['sphinx_search.extension']
+
 todo_include_todos = True
 
 top_level = os.path.dirname(
@@ -115,7 +120,7 @@ class Mock(object):
 
 sys.modules['ceph_module'] = Mock()
 
-if os.environ.get('READTHEDOCS') == 'True':
+if build_with_rtd:
     exclude_patterns += ['**/api/*',
                          '**/api.rst']
     autodoc_mock_imports = ['cephfs',