From 586a306358c555a042bcb5cfc76715756f370f87 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Thu, 13 Jul 2017 19:09:43 +0200 Subject: [PATCH] doc: migrate to openstackdocstheme Both doc/ and releasenotes/ Change-Id: Ic9a5d593053364e8b10f022b53cb0ab2587431b0 --- doc/source/conf.py | 22 ++++++++-------------- releasenotes/source/conf.py | 10 ++++++++-- test-requirements.txt | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a4d68feb..bdc4790e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,10 +40,14 @@ sys.path.append(os.path.abspath('../bin')) # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', 'ext.cli'] + 'sphinx.ext.viewcode', 'ext.cli', + 'openstackdocstheme'] -if not on_rtd: - extensions.append('oslosphinx') +# openstackdocstheme options +repository_name = 'openstack/python-saharaclient' +bug_project = 'python-saharaclient' +bug_tag = 'doc' +html_last_updated_fmt = '%Y-%m-%d %H:%M' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -110,6 +114,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 = 'openstackdocs' if on_rtd: html_theme_path = ['.'] @@ -144,17 +149,6 @@ html_title = 'Sahara Client' # so a file named "default.css" will overwrite the builtin "default.css". # 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".') - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 60ca01c4..23f10b7c 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -15,10 +15,16 @@ # Sahara Client Release Notes documentation build configuration file extensions = [ - 'oslosphinx', 'reno.sphinxext', + 'openstackdocstheme' ] +# openstackdocstheme options +repository_name = 'openstack/python-saharaclient' +bug_project = 'python-saharaclient' +bug_tag = 'releasenotes' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -55,7 +61,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 diff --git a/test-requirements.txt b/test-requirements.txt index 3f386e89..35079cae 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 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 os-testr>=0.8.0 # Apache-2.0 reno!=2.3.1,>=1.8.0 # Apache-2.0