summaryrefslogtreecommitdiff
path: root/api-ref/source/conf.py
diff options
context:
space:
mode:
authorwanghui <wang_hui@inspur.com>2018-03-27 09:53:17 +0800
committerColleen Murphy <colleen@gazlene.net>2019-04-15 19:47:58 -0700
commitde4d72c5f2e88e642fc19b53d2f9ed75157e6fab (patch)
treeea27df31047ab502e348db6967e2e289721b3122 /api-ref/source/conf.py
parentb357a96ac048a62348d081d6bf4dc9c8d0b87538 (diff)
downloadkeystone-de4d72c5f2e88e642fc19b53d2f9ed75157e6fab.tar.gz
Use openstackdocstheme according to guide
This change alters the api-ref's conf.py to follow the documentation[1]. Functionally, this results in the api-ref using the api_ref theme options, which adds a dropdown menu to the other API references instead of to unrelated documentation, and deduplicates the headers. [1] https://docs.openstack.org/openstackdocstheme/latest/ Change-Id: I706301130efac6b37d97ebd814d9987370d76692
Diffstat (limited to 'api-ref/source/conf.py')
-rw-r--r--api-ref/source/conf.py32
1 files changed, 6 insertions, 26 deletions
diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py
index c0d99bcda..1bbe49cc5 100644
--- a/api-ref/source/conf.py
+++ b/api-ref/source/conf.py
@@ -22,19 +22,15 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import subprocess
-import warnings
-
-import openstackdocstheme
-
html_theme = 'openstackdocs'
-html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme_options = {
+ "sidebar_dropdown": "api_ref",
"sidebar_mode": "toc",
}
extensions = [
'os_api_ref',
+ 'openstackdocstheme',
]
@@ -65,22 +61,12 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'Identity API Reference'
copyright = u'2010-present, OpenStack Foundation'
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-from keystone import version as keystone_version
-# The short X.Y version.
-version = keystone_version.release_string()
-# The full version, including alpha/beta/rc tags.
-release = keystone_version.release_string()
-
-# html_context allows us to pass arbitrary values into the html template
-html_context = {"bug_tag": "api-ref",
- "bug_project": "keystone"}
+# -- Options for openstackdocstheme -------------------------------------------
+repository_name = 'openstack/keystone'
+bug_project = 'keystone'
+bug_tag = 'api-ref'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -165,12 +151,6 @@ pygments_style = 'sphinx'
# using the given strftime format.
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
"-n1"]
-try:
- html_last_updated_fmt = subprocess.check_output(
- git_cmd).decode('utf-8')
-except Exception:
- warnings.warn('Cannot get last updated time from git repository. '
- 'Not setting "html_last_updated_fmt".')
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.