From bf9e3e02c09cf0822b3d19c3b75c6bd3df32b43a Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Fri, 30 Jun 2017 16:27:36 +0300 Subject: [PATCH] Use openstackdocstheme over oslosphinx This commit is part of general doc-migration effort. It replaces oslosphinx with openstackdocstheme and marks docs warnings to be treated as errors. Kuryr projects do not seem to have any docs in the openstack-manuals, so there are no docs we need to pull from that repo. However being the official project kuryr would benefit from unifying its docs with the rest of openstack projects as well as using openstackdocstheme, theme intended for official projects https://docs.openstack.org/openstackdocstheme/latest/ See https://specs.openstack.org/openstack/docs-specs/specs/pike/os-manuals-migration.html and https://etherpad.openstack.org/p/doc-migration-tracking for more information Change-Id: Iaba05a9e50e1c1e1bdd821a1222b392038561e63 --- README.rst | 2 +- doc/source/conf.py | 13 +++++++++---- releasenotes/source/conf.py | 15 ++++++++++++--- setup.cfg | 1 + test-requirements.txt | 2 +- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 75fb9007..f5276621 100644 --- a/README.rst +++ b/README.rst @@ -442,7 +442,7 @@ documentation. You can install Sphinx using pip:: In addition to Sphinx you will also need the following requirements (not covered by `requirements.txt`):: - $ pip install oslosphinx reno 'reno[sphinx]' + $ pip install openstackdocstheme reno 'reno[sphinx]' The source code of the documentation are under *doc*, you can generate the html files using the following command. If the generation succeeds,a diff --git a/doc/source/conf.py b/doc/source/conf.py index e01d54f0..3b5cbf09 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,9 +22,8 @@ sys.path.insert(0, os.path.abspath('../..')) # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - #'sphinx.ext.intersphinx', - 'oslosphinx', - 'reno.sphinxext' + 'reno.sphinxext', + 'openstackdocstheme', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy @@ -41,6 +40,12 @@ master_doc = 'index' project = u'kuryr-libnetwork' copyright = u'2013, OpenStack Foundation' +# openstackdocstheme options +repository_name = 'openstack/kuryr-libnetwork' +bug_project = 'kuryr-libnetwork' +bug_tag = '' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True @@ -56,7 +61,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] -# html_theme = '_theme' +html_theme = 'openstackdocs' # html_static_path = ['static'] # Output file base name for HTML help builder. diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index afce30e4..ad886200 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -30,8 +30,10 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['reno.sphinxext', - 'oslosphinx'] +extensions = [ + 'reno.sphinxext', + 'openstackdocstheme', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -50,6 +52,12 @@ project = u'Kuryr-Libnetwork' copyright = u'2017, Kuryr-Libnetwork Developers' author = u'Kuryr-Libnetwork Developers' +# openstackdocstheme options +repository_name = 'openstack/kuryr-libnetwork' +bug_project = 'kuryr-libnetwork' +bug_tag = '' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. @@ -84,7 +92,8 @@ todo_include_todos = False # 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/setup.cfg b/setup.cfg index dd6e9872..f802789f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,6 +38,7 @@ data_files = source-dir = doc/source build-dir = doc/build all_files = 1 +warning-is-error = 1 [upload_sphinx] upload-dir = doc/build/html diff --git a/test-requirements.txt b/test-requirements.txt index 6bb7aba8..986d220b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,7 @@ docker>=2.0.0 # Apache-2.0 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 os-testr>=0.8.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0 -oslosphinx>=4.7.0 # Apache-2.0 +openstackdocstheme>=1.11.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 python-subunit>=0.0.18 # Apache-2.0/BSD reno!=2.3.1,>=1.8.0 # Apache-2.0