Switch from oslosphinx to openstackdocstheme

As part of the docs migration work[0] for Pike we need to switch to use
the openstackdocstheme.

[0]https://review.openstack.org/#/c/472275/

Change-Id: I31543b78a1b2d2df685e295d4d011c5e6e4a165b
This commit is contained in:
Van Hung Pham 2017-06-30 14:07:10 +07:00
parent bebd7056ad
commit 6e631db558
3 changed files with 15 additions and 17 deletions

View File

@ -25,11 +25,7 @@
# serve to show the default. # serve to show the default.
import os import os
import subprocess
import sys import sys
import warnings
import openstackdocstheme
# NOTE(dstanek): adds _ to the builtins so keystone modules can be imported # NOTE(dstanek): adds _ to the builtins so keystone modules can be imported
__builtins__['_'] = str __builtins__['_'] = str
@ -54,7 +50,7 @@ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'oslo_config.sphinxconfiggen', 'oslo_config.sphinxconfiggen',
'oslo_policy.sphinxpolicygen', 'oslo_policy.sphinxpolicygen',
'oslosphinx', 'openstackdocstheme',
'ext.support_matrix', 'ext.support_matrix',
] ]
@ -137,7 +133,6 @@ man_pages = [
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme_path = [openstackdocstheme.get_html_theme_path()]
html_theme = 'openstackdocs' html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
@ -172,14 +167,7 @@ html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y' # html_last_updated_fmt = '%b %d, %Y'
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", html_last_updated_fmt = '%Y-%m-%d %H:%M'
"-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".')
# If true, SmartyPants will be used to convert quotes and dashes to # If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities. # typographically correct entities.
@ -287,3 +275,8 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.
# intersphinx_mapping = {'http://docs.python.org/': None} # intersphinx_mapping = {'http://docs.python.org/': None}
# -- Options for openstackdocstheme -------------------------------------------
repository_name = 'openstack/keystone'
bug_project = 'keystone'
bug_tag = 'doc'

View File

@ -37,7 +37,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
'oslosphinx', 'openstackdocstheme',
'reno.sphinxext', 'reno.sphinxext',
] ]
@ -112,7 +112,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # 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 # 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 # further. For a list of options available for each theme, see the
@ -151,6 +151,7 @@ html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. # using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y' # 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 # If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities. # typographically correct entities.
@ -275,3 +276,8 @@ texinfo_documents = [
# -- Options for Internationalization output ------------------------------ # -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/'] locale_dirs = ['locale/']
# -- Options for openstackdocstheme -------------------------------------------
repository_name = 'openstack/keystone'
bug_project = 'keystone'
bug_tag = 'doc'

View File

@ -33,7 +33,6 @@ testtools>=1.4.0 # MIT
# For documentation # For documentation
openstackdocstheme>=1.11.0 # Apache-2.0 openstackdocstheme>=1.11.0 # Apache-2.0
oslosphinx>=4.7.0 # Apache-2.0
reno!=2.3.1,>=1.8.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0
tempest>=14.0.0 # Apache-2.0 tempest>=14.0.0 # Apache-2.0