From dfc2257c559c1b73f62e02b0771a01a265bc1560 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 28 Jun 2017 15:13:31 +0000 Subject: [PATCH] Update openstackdocstheme configuration In openstackdocstheme 0.11.0, the way to configure openstackdocstheme was changed and the new way is really simple. Let's use it. Change-Id: I3f8775cc54ece19915ab7b06285a0e7d2995eb8b --- doc/source/conf.py | 22 ++++++++-------------- releasenotes/source/conf.py | 27 ++++++++------------------- test-requirements.txt | 2 +- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index bba8522..32acffc 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -28,7 +28,6 @@ import os import sys import django -import openstackdocstheme PROJECT = 'neutron-vpnaas-dashboard' BASE_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -64,8 +63,15 @@ extensions = [ 'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'reno.sphinxext', + 'openstackdocstheme', ] +# openstackdocstheme options +repository_name = 'openstack/neutron-vpnaas-dashboard' +bug_project = 'neutron-vpnaas-dashboard' +bug_tag = 'doc' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -144,7 +150,7 @@ html_theme_options = { } # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = [openstackdocstheme.get_html_theme_path()] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -171,18 +177,6 @@ html_static_path = [] # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' -gitsha = os.popen("/usr/bin/git rev-parse HEAD").read() -giturl = ('https://git.openstack.org/cgit/openstack/%s/tree/doc/source' - % PROJECT) -html_context = { - 'gitsha': gitsha, - 'giturl': giturl, - 'bug_project': PROJECT, - 'bug_tag': 'doc', -} -html_last_updated_fmt = os.popen("git log --pretty=format:'%ad' " - "--date=format:'%Y-%m-%d %H:%M' -n1").read() - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 83c9e6c..20404bb 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -29,12 +29,6 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) -import os - -import openstackdocstheme - -PROJECT = 'neutron-vpnaas-dashboard' - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -45,8 +39,15 @@ PROJECT = 'neutron-vpnaas-dashboard' # ones. extensions = [ 'reno.sphinxext', + 'openstackdocstheme', ] +# openstackdocstheme options +repository_name = 'openstack/neutron-vpnaas-dashboard' +bug_project = 'neutron-vpnaas-dashboard' +bug_tag = 'doc' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] @@ -125,7 +126,7 @@ html_theme = 'openstackdocs' # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = [openstackdocstheme.get_html_theme_path()] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -197,17 +198,5 @@ html_static_path = [] # Output file base name for HTML help builder. htmlhelp_basename = 'neutronvpnaasdashboardReleaseNotesdoc' -gitsha = os.popen("/usr/bin/git rev-parse HEAD").read() -giturl = ('https://git.openstack.org/cgit/openstack/%s/tree/doc/source' - % PROJECT) -html_context = { - 'gitsha': gitsha, - 'giturl': giturl, - 'bug_project': PROJECT, - 'bug_tag': 'doc', -} -html_last_updated_fmt = os.popen("git log --pretty=format:'%ad' " - "--date=format:'%Y-%m-%d %H:%M' -n1").read() - # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] diff --git a/test-requirements.txt b/test-requirements.txt index 721ff96..50a8396 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,7 +11,7 @@ mock>=2.0 # BSD mox3!=0.19.0,>=0.7.0 # Apache-2.0 python-subunit>=0.0.18 # Apache-2.0/BSD sphinx!=1.6.1,>=1.5.1 # BSD -openstackdocstheme>=1.5.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT