From bdfa6d59cc014b4cb0786c790f7ae268c8598baa Mon Sep 17 00:00:00 2001 From: Van Hung Pham Date: Fri, 30 Jun 2017 15:36:37 +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: I47d858fafd5d57f00cab9d7a4b87950320febf70 --- doc/source/conf.py | 15 ++++++++------- test-requirements.txt | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 3498ed7..83f5f04 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -39,6 +39,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.intersphinx', + 'openstackdocstheme', ] todo_include_todos = True @@ -116,6 +117,7 @@ modindex_common_prefix = ['ldappool.'] # 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 @@ -148,13 +150,7 @@ modindex_common_prefix = ['ldappool.'] # 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: - 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. @@ -228,3 +224,8 @@ latex_documents = [ intersphinx_mapping = { 'python': ('http://docs.python.org/', None), } + +# -- Options for openstackdocstheme ------------------------------------------- +repository_name = 'openstack/ldappool' +bug_project = 'ldappool' +bug_tag = '' diff --git a/test-requirements.txt b/test-requirements.txt index 5400200..a84ecb2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,8 @@ flake8-docstrings==0.2.1.post1 # MIT coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -sphinx!=1.6.1,>=1.5.1 # BSD +sphinx>=1.6.2 # BSD +openstackdocstheme>=1.11.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT