From fd28742be0ca722ad2749987bfb79c6032bfe406 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 21 May 2020 10:26:20 +0200 Subject: [PATCH] Switch to newer openstackdocstheme and reno versions Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using these versions will allow especially: * Linking from HTML to PDF document * Allow parallel building of documents * Fix some rendering problems Update Sphinx version as well. Set openstackdocs_pdf_link to link to PDF file. Note that the link to the published document only works on docs.openstack.org where the PDF file is placed in the top-level html directory. The site-preview places the PDF in a pdf directory. Set openstackdocs_auto_name to use 'project' as name. Change pygments_style to 'native' since old theme version always used 'native' and the theme now respects the setting and using 'sphinx' can lead to some strange rendering. Remove docs requirements from lower-constraints, they are not needed during install or test but only for docs building. openstackdocstheme renames some variables, so follow the renames before the next release removes them. A couple of variables are also not needed anymore, remove them. See also http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html Change-Id: I9daf3a281bdd5371e727dfd2f9a8a1f8e5cef68b --- api-ref/source/conf.py | 24 +++++------------------- doc/requirements.txt | 6 +++--- doc/source/conf.py | 12 +++++------- lower-constraints.txt | 4 ---- releasenotes/source/conf.py | 12 +++++------- 5 files changed, 18 insertions(+), 40 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 045790dd7..a6b8a1e80 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -62,16 +62,6 @@ master_doc = 'index' project = u'Containers Service API Reference' copyright = u'2010-present, OpenStack Foundation' -# 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. -# -from zun.version import version_info -# The full version, including alpha/beta/rc tags. -release = version_info.release_string() -# The short X.Y version. -version = version_info.version_string() - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -99,12 +89,13 @@ add_module_names = False show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # openstackdocstheme options -repository_name = 'openstack/zun' -bug_project = 'zun' -bug_tag = 'api-ref' +openstackdocs_repo_name = 'openstack/zun' +openstackdocs_bug_project = 'zun' +openstackdocs_bug_tag = 'api-ref' +openstackdocs_auto_name = False # -- Options for man page output ---------------------------------------------- @@ -148,11 +139,6 @@ bug_tag = 'api-ref' # 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' -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True diff --git a/doc/requirements.txt b/doc/requirements.txt index ecc028876..073b1d633 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,8 +2,8 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. # this is required for the docs build jobs -sphinx>=1.8.0,!=2.1.0 # BSD +sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD -openstackdocstheme>=1.11.0 # Apache-2.0 -reno>=1.8.0 # Apache-2.0 +openstackdocstheme>=2.2.1 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 os-api-ref>=1.0.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 59af1189a..53a158144 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,9 +40,10 @@ source_suffix = '.rst' master_doc = 'index' # openstackdocstheme options -repository_name = 'openstack/zun' -bug_project = 'zun' -bug_tag = '' +openstackdocs_repo_name = 'openstack/zun' +openstackdocs_pdf_link = True +openstackdocs_bug_project = 'zun' +openstackdocs_bug_tag = '' config_generator_config_file = '../../etc/zun/zun-config-generator.conf' sample_config_basename = '_static/zun' @@ -62,7 +63,7 @@ add_function_parentheses = True add_module_names = True # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # -- Options for HTML output -------------------------------------------------- @@ -95,8 +96,5 @@ latex_elements = { 'extraclassoptions': 'openany', } -# Must set this variable to include year, month, day, hours, and minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # Example configuration for intersphinx: refer to the Python standard library. # intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/lower-constraints.txt b/lower-constraints.txt index 876ea66fe..f9dd3408e 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -61,7 +61,6 @@ munch==2.2.0 netifaces==0.10.6 neutron-lib==1.13.0 numpy==1.14.2 -openstackdocstheme==1.18.1 openstacksdk==0.12.0 os-api-ref==1.4.0 os-brick==2.2.0 @@ -127,7 +126,6 @@ python-subunit==1.2.0 python-zunclient==3.5.0 pytz==2018.3 PyYAML==3.12 -reno==2.5.0 repoze.lru==0.7 requests==2.18.4 requestsexceptions==1.4.0 @@ -139,8 +137,6 @@ simplegeneric==0.8.1 simplejson==3.13.2 smmap2==2.0.3 snowballstemmer==1.2.1 -Sphinx==1.8.0 -sphinxcontrib-websupport==1.0.1 SQLAlchemy==1.0.10 sqlalchemy-migrate==0.11.0 sqlparse==0.2.4 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index df706ee75..be9d66aa5 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -93,7 +93,7 @@ exclude_patterns = [] # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] @@ -109,9 +109,10 @@ pygments_style = 'sphinx' html_theme = 'openstackdocs' # openstackdocstheme options -repository_name = 'openstack/zun' -bug_project = 'zun' -bug_tag = '' +openstackdocs_repo_name = 'openstack/zun' +openstackdocs_bug_project = 'zun' +openstackdocs_bug_tag = '' +openstackdocs_auto_name = False # 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 @@ -147,9 +148,6 @@ bug_tag = '' # directly to the root of the documentation. # html_extra_path = [] -# Must set this variable to include year, month, day, hours, and minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True