Skip to content

Commit aa893d9

Browse files
committed
Get ready for os-api-ref sphinx theme change
Change-Id: Ib4aa4a26814273efafa3453237d18acf8cc966cb
1 parent 5e0178d commit aa893d9

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

Diff for: api-ref/source/conf.py

+30-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,36 @@
2929
import sys
3030
import warnings
3131

32+
# TODO(Graham Hayes): Remove the following block of code when os-api-ref is
33+
# using openstackdocstheme
34+
35+
import os_api_ref
36+
37+
if getattr(os_api_ref, 'THEME', 'olsosphinx') == 'openstackdocstheme':
38+
# We are on the new version with openstackdocstheme support
39+
40+
extensions = [
41+
'os_api_ref',
42+
]
43+
44+
import openstackdocstheme # noqa
45+
46+
html_theme = 'openstackdocs'
47+
html_theme_path = [openstackdocstheme.get_html_theme_path()]
48+
html_theme_options = {
49+
"sidebar_mode": "toc",
50+
}
51+
52+
else:
53+
# We are on the old version without openstackdocstheme support
54+
55+
extensions = [
56+
'os_api_ref',
57+
'oslosphinx',
58+
]
59+
60+
# End temporary block
61+
3262
# If extensions (or modules to document with autodoc) are in another directory,
3363
# add these directories to sys.path here. If the directory is relative to the
3464
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -41,11 +71,6 @@
4171
# Add any Sphinx extension module names here, as strings. They can be
4272
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4373

44-
extensions = [
45-
'os_api_ref',
46-
'oslosphinx',
47-
]
48-
4974
# The suffix of source filenames.
5075
source_suffix = '.rst'
5176

0 commit comments

Comments
 (0)