From 76f9dfe23759202feabbdc88e1cfd0c7304b56f0 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 6 Jul 2017 06:53:04 +0900 Subject: [PATCH] Switch from oslosphinx to openstackdocstheme * Switch the release note theme to openstackdocstheme. * Use the new style of setting of openstackdocstheme of the in-tree documentation. Change-Id: I0424f097c0f5d78a539bc997e2cd61119d606524 --- doc/source/conf.py | 29 +++++++---------------------- releasenotes/source/conf.py | 11 ++++++++--- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index fc97d6a2d99..e54339d5dc3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -27,11 +27,7 @@ # serve to show the default. import os -import subprocess import sys -import warnings - -import openstackdocstheme # 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 @@ -50,8 +46,14 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.ifconfig', 'sphinx.ext.graphviz', 'sphinx.ext.todo', + 'openstackdocstheme', 'support_matrix'] +# openstackdocstheme options +repository_name = 'openstack/neutron' +bug_project = 'neutron' +bug_tag = 'doc' + todo_include_todos = True # Add any paths that contain templates here, relative to this directory. @@ -136,7 +138,6 @@ html_theme = 'openstackdocs' # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = ['_theme'] -html_theme_path = [openstackdocstheme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -161,23 +162,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' -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".') - -gitsha = os.popen("/usr/bin/git rev-parse HEAD").read() -giturl = u'https://git.openstack.org/cgit/openstack/neutron/tree/doc/source' -# html_context allows us to pass arbitrary values into the html template -html_context = { - "gitsha": gitsha, - "giturl": giturl, - "bug_project": "neutron", - "bug_tag": "doc", - } +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 510739e08a4..7dad597a490 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -37,10 +37,15 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] +# openstackdocstheme options +repository_name = 'openstack/neutron' +bug_project = 'neutron' +bug_tag = 'doc' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -140,7 +145,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 @@ -149,7 +154,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.