diff options
author | Graham Hayes <graham.hayes@hpe.com> | 2016-08-19 14:25:06 +0100 |
---|---|---|
committer | Graham Hayes <graham.hayes@hpe.com> | 2016-08-19 16:44:07 +0100 |
commit | aa893d90778f912fa6668f9e3c462885654c423a (patch) | |
tree | 7289bc6cf4ec113d7ea2387fa624d5980c232b65 /api-ref/source/conf.py | |
parent | 5e0178d75b4330b13571cb5d91c513c0a66dfed0 (diff) | |
download | swift-aa893d90778f912fa6668f9e3c462885654c423a.tar.gz |
Get ready for os-api-ref sphinx theme change
Change-Id: Ib4aa4a26814273efafa3453237d18acf8cc966cb
Diffstat (limited to 'api-ref/source/conf.py')
-rw-r--r-- | api-ref/source/conf.py | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index e01012aeb..3ec1303ce 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -29,6 +29,36 @@ import subprocess import sys import warnings +# 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. @@ -41,11 +71,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' |