From 216cfada467f36f35e842caffbfa914bd7a8145f Mon Sep 17 00:00:00 2001 From: "bhavani.cr" Date: Tue, 4 Jul 2017 15:03:26 +0530 Subject: [PATCH] Fix openstackdocstheme settings To use openstackdocstheme 1.11.0 properly, this patch fixes some settings according to follow. https://docs.openstack.org/openstackdocstheme/latest/ Change-Id: Iefc14c0fba91e6ff442339278a510d64b2d42bff --- doc/source/conf.py | 24 +++++++++--------------- releasenotes/source/conf.py | 14 +++++++++----- test-requirements.txt | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index eaaeb09..49b3e60 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,8 +23,6 @@ # serve to show the default. import pbr.version -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 @@ -40,7 +38,7 @@ import warnings # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx' + 'openstackdocstheme', ] # Add any paths that contain templates here, relative to this directory. @@ -117,7 +115,12 @@ nitpicky = False # 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' + +# openstackdocstheme options +repository_name = 'openstack/python-senlinclient' +bug_project = 'python-senlinclient' +bug_tag = '' # 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 @@ -153,17 +156,8 @@ html_theme = 'default' # directly to the root of the documentation. # html_extra_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.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' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 90f9f2d..f56dd74 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -39,8 +39,8 @@ import pbr.version # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', 'reno.sphinxext', + 'openstackdocstheme', ] # Add any paths that contain templates here, relative to this directory. @@ -114,7 +114,12 @@ 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' + +# openstackdocstheme options +repository_name = 'openstack/python-senlinclient' +bug_project = 'python-senlinclient' +bug_tag = '' # 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 @@ -150,9 +155,8 @@ html_static_path = ['_static'] # directly to the root of the documentation. # html_extra_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' +# 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. diff --git a/test-requirements.txt b/test-requirements.txt index b43bb8e..8f91fdd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD requests-mock>=1.1 # Apache-2.0 mock>=2.0 # BSD -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,>=16.0 # PSF/ZPL sphinx>=1.6.2 # BSD