From 478b63046bc2091e71d3b56532f641165cce29a8 Mon Sep 17 00:00:00 2001 From: lingyongxu Date: Thu, 6 Jul 2017 09:58:07 +0800 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: I8aad9f2c5f610f8f5241fdddc21ea2a0536d1fd3 --- doc/source/conf.py | 28 ++++++++++------------------ releasenotes/source/conf.py | 13 +++++++++---- setup.cfg | 2 +- test-requirements.txt | 2 +- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 64c4c71a..88d81c38 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -25,8 +25,6 @@ import sys import os -import subprocess -import warnings # 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 @@ -46,7 +44,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.ifconfig', 'sphinx.ext.intersphinx', 'sphinx.ext.graphviz', - 'oslosphinx', + 'openstackdocstheme', ] # autodoc generation is a bit aggressive and a nuisance @@ -59,11 +57,7 @@ todo_include_todos = True # Changing the path so that the Hudson build output contains GA code # and the source docs do not contain the code so local, offline sphinx builds # are "clean." -templates_path = [] -if os.getenv('HUDSON_PUBLISH_DOCS'): - templates_path = ['_ga', '_templates'] -else: - templates_path = ['_templates'] +#templates_path = [] # The suffix of source filenames. source_suffix = '.rst' @@ -137,7 +131,7 @@ modindex_common_prefix = ['zaqarclient.'] # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] -# html_theme = '_theme' +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 @@ -170,15 +164,8 @@ html_static_path = [] # 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.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] -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' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. @@ -247,3 +234,8 @@ latex_documents = [ # If false, no module index is generated. #latex_use_modindex = True + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/python-zaqarclient' +bug_project = 'python-zaqarclient' +bug_tag = '' diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index c59fceb8..869dc64c 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -39,12 +39,12 @@ from zaqarclient.version import version_info as zaqarclient_version # 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' @@ -111,7 +111,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 @@ -140,7 +140,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'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -274,3 +274,8 @@ texinfo_documents = [ # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/python-zaqarclient' +bug_project = 'python-zaqarclient' +bug_tag = '' diff --git a/setup.cfg b/setup.cfg index 4c71518d..1480334d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ description-file = README.rst author = OpenStack author-email = openstack-dev@lists.openstack.org -home-page = http://docs.openstack.org/developer/zaqar/ +home-page = https://docs.openstack.org/zaqar/latest/ classifier = Development Status :: 4 - Beta Environment :: Console diff --git a/test-requirements.txt b/test-requirements.txt index 114ce182..9584206c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -24,6 +24,6 @@ ddt>=1.0.1 # MIT # Documentation sphinx>=1.6.2 # BSD os-client-config>=1.27.0 # Apache-2.0 -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0 requests-mock>=1.1 # Apache-2.0