From bff426f0eb4a263e442633f01094b3c1b060d4e4 Mon Sep 17 00:00:00 2001 From: Dong Ma Date: Tue, 4 Jul 2017 02:21:00 +0800 Subject: [PATCH] switch from oslosphinx to openstackdocstheme Change-Id: Ic3d9b9cbef0040512e37c8e99df7bb028e344bc9 --- doc/source/conf.py | 20 ++++++++++---------- releasenotes/source/conf.py | 12 ++++++++++-- test-requirements.txt | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9ac6887c2..8eaa340f5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -12,11 +12,19 @@ sys.path.insert(0, os.path.abspath('../..')) # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - 'oslosphinx', + 'openstackdocstheme', 'stevedore.sphinxext', 'oslo_config.sphinxext', ] +# openstackdocstheme options +repository_name = 'openstack/oslo.messaging' +bug_project = 'oslo.messaging' +bug_tag = '' + +# Must set this variable to include year, month, day, hours, and minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable @@ -49,20 +57,12 @@ pygments_style = 'sphinx' # 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' # html_static_path = ['static'] # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project -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".') - # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 80658df00..9bb2c4be6 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -38,10 +38,18 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] +# openstackdocstheme options +repository_name = 'openstack/oslo.messaging' +bug_project = 'oslo.messaging' +bug_tag = '' + +# Must set this variable to include year, month, day, hours, and minutes. +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -112,7 +120,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 diff --git a/test-requirements.txt b/test-requirements.txt index 415bb4f36..31991e852 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -29,7 +29,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 # this is required for the docs build jobs sphinx>=1.6.2 # BSD -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0 # AMQP 1.0 support depends on the Qpid Proton AMQP 1.0