From 27296d58587a1a41535667d04b76c466ac404b53 Mon Sep 17 00:00:00 2001 From: Van Hung Pham Date: Fri, 30 Jun 2017 15:21:25 +0700 Subject: [PATCH] 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: I5150a456df75d61035a6f00366fa70bd4ec83457 --- doc/source/conf.py | 19 ++++++++----------- releasenotes/source/conf.py | 10 ++++++++-- test-requirements.txt | 4 ++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 323a0302..504eb9a2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -13,9 +13,7 @@ from __future__ import unicode_literals import os -import subprocess import sys -import warnings import pbr.version @@ -43,7 +41,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.intersphinx', - 'oslosphinx', + 'openstackdocstheme', 'oslo_config.sphinxconfiggen' ] @@ -126,6 +124,7 @@ modindex_common_prefix = ['keystonemiddleware.'] # Sphinx are currently 'default' and 'sphinxdoc'. #html_theme_path = ["."] #html_theme = '_theme' +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 @@ -158,14 +157,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' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. @@ -241,3 +233,8 @@ keystoneclient = 'https://docs.openstack.org/developer/python-keystoneclient/' intersphinx_mapping = {'keystoneclient': (keystoneclient, None), } + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/keystonemiddleware' +bug_project = 'keystonemiddleware' +bug_tag = '' diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index eab8c725..5043d3a5 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -37,7 +37,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] @@ -112,7 +112,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 @@ -151,6 +151,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. @@ -277,3 +278,8 @@ texinfo_documents = [ # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/keystonemiddleware' +bug_project = 'keystonemiddleware' +bug_tag = '' diff --git a/test-requirements.txt b/test-requirements.txt index c17dab0a..f0a7384e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,11 +10,11 @@ cryptography>=1.6 # BSD/Apache-2.0 docutils>=0.11 # OSI-Approved Open Source, Public Domain fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0 # BSD -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0 requests-mock>=1.1 # Apache-2.0 -sphinx!=1.6.1,>=1.5.1 # BSD +sphinx>=1.6.2 # BSD stevedore>=1.20.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD