From ef86e88f9fde0c2087de9e41869628c0c222ce59 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 6 Jul 2017 21:33:33 +0000 Subject: [PATCH] Switch from oslosphinx to openstackdocstheme Change-Id: Ic6d11356de62f9779f96fbe15160ee1004c45245 --- doc/source/conf.py | 22 +++++++++------------- releasenotes/source/conf.py | 11 ++++++++--- test-requirements.txt | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c71f5a9..8412b05 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,11 +11,8 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import datetime import os -import subprocess import sys -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 @@ -39,8 +36,14 @@ extensions = [ 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'oslosphinx', + 'openstackdocstheme', ] + +# openstackdocstheme options +repository_name = 'openstack/osprofiler' +bug_project = 'osprofiler' +bug_tag = '' + todo_include_todos = True # Add any paths that contain templates here, relative to this directory. @@ -98,7 +101,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 @@ -131,14 +134,7 @@ html_static_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -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".') +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 a11b9a9..6d5caab 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -35,10 +35,15 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] +# openstackdocstheme options +repository_name = 'openstack/osprofiler' +bug_project = 'osprofiler' +bug_tag = '' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -109,7 +114,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 @@ -147,7 +152,7 @@ html_static_path = ['_static'] # 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' +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 89306a8..aa45596 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,7 @@ python-subunit>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD testtools>=1.4.0 # MIT -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 sphinx>=1.6.2 # BSD # Bandit security code scanner