doc: Switch to openstackdocstheme

Change-Id: If7afc2cb58759b16fc6f7caa44d0cf6b7bcf4d06
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
chenxing 2017-06-27 05:12:31 +00:00 committed by Stephen Finucane
parent e62d931025
commit fa0e8f69b4
3 changed files with 19 additions and 14 deletions

View File

@ -17,9 +17,7 @@
# http://www.sphinx-doc.org/en/stable/config.html
import os
import subprocess
import sys
import warnings
from nova.version import version_info
@ -37,9 +35,9 @@ sys.path.insert(0, os.path.abspath('./'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'openstackdocstheme',
'sphinx.ext.coverage',
'sphinx.ext.graphviz',
'oslosphinx',
'ext.support_matrix',
'oslo_config.sphinxconfiggen',
'oslo_policy.sphinxpolicygen',
@ -47,6 +45,11 @@ extensions = ['sphinx.ext.autodoc',
'ext.feature_matrix',
]
# openstackdocstheme options
repository_name = 'openstack/nova'
bug_project = 'nova'
bug_tag = ''
config_generator_config_file = '../../etc/nova/nova-config-generator.conf'
sample_config_basename = '_static/nova'
@ -128,6 +131,10 @@ man_pages = [
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'openstackdocs'
# 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".
@ -135,13 +142,7 @@ html_static_path = ['_static']
# 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.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".')
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# -- Options for LaTeX output -------------------------------------------------

View File

@ -24,7 +24,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'oslosphinx',
'openstackdocstheme',
'reno.sphinxext',
]
@ -43,6 +43,10 @@ master_doc = 'index'
# General information about the project.
project = u'Nova Release Notes'
copyright = u'2015, Nova developers'
# openstackdocstheme options
repository_name = 'openstack/nova'
bug_project = 'nova'
bug_tag = ''
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -97,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
@ -136,6 +140,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.

View File

@ -16,7 +16,6 @@ python-subunit>=0.0.18 # Apache-2.0/BSD
requests-mock>=1.1 # Apache-2.0
sphinx>=1.6.2 # BSD
os-api-ref>=1.0.0 # Apache-2.0
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
os-testr>=0.8.0 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0