Get ready for os-api-ref sphinx theme change

Change-Id: If3f7c1d68e1f278cd5fbcb43fb686828e01d05fe
This commit is contained in:
Graham Hayes 2016-08-19 14:28:42 +01:00
parent c5245e61e0
commit f262e685b3
1 changed files with 30 additions and 5 deletions

View File

@ -28,6 +28,36 @@ import sys
from designate.version import version_info
# TODO(Graham Hayes): Remove the following block of code when os-api-ref is
# using openstackdocstheme
import os_api_ref
if getattr(os_api_ref, 'THEME', 'olsosphinx') == 'openstackdocstheme':
# We are on the new version with openstackdocstheme support
extensions = [
'os_api_ref',
]
import openstackdocstheme # noqa
html_theme = 'openstackdocs'
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme_options = {
"sidebar_mode": "toc",
}
else:
# We are on the old version without openstackdocstheme support
extensions = [
'os_api_ref',
'oslosphinx',
]
# End temporary block
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@ -40,11 +70,6 @@ sys.path.insert(0, os.path.abspath('./'))
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'os_api_ref',
'oslosphinx',
]
# The suffix of source filenames.
source_suffix = '.rst'