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
This commit is contained in:
Akihiro Motoki 2017-07-06 06:53:04 +09:00
parent df762b0d46
commit 76f9dfe237
2 changed files with 15 additions and 25 deletions

View File

@ -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
# "<project> v<release> 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.

View File

@ -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.