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

Signed-off-by: Kefu Chai <kchai@redhat.com>
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 92d5329e7f15923e40f16e038d3d9e174d9b642e..ee3dec12025c47c22e88468848ee841b370c3d49 100644 (file)
@@ -58,6 +58,7 @@ extensions = [
     'edit_on_github',
     'ceph_releases',
     ]
+
 ditaa = shutil.which("ditaa")
 if ditaa is not None:
     extensions += ['sphinxcontrib.ditaa']
@@ -67,6 +68,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(
@@ -122,7 +127,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',