From 70202760f65cf2fd666f6fe13347bb2c03f2d32c Mon Sep 17 00:00:00 2001 From: Sharat Sharma Date: Mon, 3 Jul 2017 18:17:44 +0530 Subject: [PATCH] Switch from oslosphinx to openstackdocstheme As part of the docs migration work[0] for Pike we need to switch to use the openstackdocstheme. [0]https://review.openstack.org/#/c/472275/ Change-Id: I7648dc5681020ffa34c65244117a8e243c29a51d --- doc/source/conf.py | 27 +++++++++------------------ releasenotes/source/conf.py | 15 +++++++++++---- test-requirements.txt | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 443d7fbd..59f8378a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,9 +2,7 @@ import os import pbr.version -import subprocess import sys -import warnings on_rtd = os.environ.get('READTHEDOCS', None) == 'True' @@ -21,14 +19,11 @@ sys.path.insert(0, os.path.abspath('./')) # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - 'oslosphinx', + 'openstackdocstheme', ] -if not on_rtd: - extensions.append('oslosphinx') - # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +# templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -73,21 +68,13 @@ modindex_common_prefix = ['mistralclient.'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -if on_rtd: - html_theme_path = ['.'] - html_theme = 'sphinx_rtd_theme' +html_theme = 'openstackdocs' # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' -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".') +# Must set this variable to include year, month, day, hours, and minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -118,3 +105,7 @@ man_pages = [ [u'Mistral Contributors'], 1) ] +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/python-mistralclient' +bug_project = 'python-mistralclient' +bug_tag = '' diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index ce6fbee7..31ea0dd0 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -38,12 +38,12 @@ import pbr.version # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +# templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -77,6 +77,8 @@ release = mistralclient_version.version_string_with_vcs() # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' +# Must set this variable to include year, month, day, hours, and minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -108,7 +110,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -137,7 +139,7 @@ html_theme = 'default' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -264,3 +266,8 @@ texinfo_documents = [ # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/python-mistralclient' +bug_project = 'python-mistralclient' +bug_tag = '' diff --git a/test-requirements.txt b/test-requirements.txt index 0710d0be..075f857b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,4 +11,4 @@ requests-mock>=1.1 # Apache-2.0 tempest>=14.0.0 # Apache-2.0 osprofiler>=1.4.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0 -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0