diff options
author | Andreas Jaeger <aj@suse.com> | 2020-06-02 18:53:59 +0200 |
---|---|---|
committer | Andreas Jaeger <aj@suse.com> | 2020-06-03 08:31:04 +0200 |
commit | 3d105b623d13d8fe6bb4db676196a44ac3db464f (patch) | |
tree | aaded49f26c46d0e7c7d85e5e9338beafc667916 /api-ref | |
parent | 019bade19cd20aaebb6dd1f423ab2dbb15cd12a1 (diff) | |
download | swift-3d105b623d13d8fe6bb4db676196a44ac3db464f.tar.gz |
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.
Disable openstackdocs_auto_name to use 'project' variable as name.
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.
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: I131850d2a5c6164dfd48c9c95885d4754b5236c6
Diffstat (limited to 'api-ref')
-rw-r--r-- | api-ref/source/conf.py | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index cb2f07428..dea25e9c7 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -25,21 +25,18 @@ import datetime import os -from swift import __version__ -import subprocess import sys import warnings -import openstackdocstheme html_theme = 'openstackdocs' -html_theme_path = [openstackdocstheme.get_html_theme_path()] html_theme_options = { "sidebar_mode": "toc", } extensions = [ 'os_api_ref', + 'openstackdocstheme' ] # If extensions (or modules to document with autodoc) are in another directory, @@ -68,19 +65,6 @@ master_doc = 'index' project = u'Object Storage 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. -# -# The short X.Y version. -version = __version__.rsplit('.', 1)[0] -# The full version, including alpha/beta/rc tags. -release = __version__ - -# html_context allows us to pass arbitrary values into the html template -html_context = {'bug_tag': 'api-ref', - 'bug_project': 'swift'} - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -108,7 +92,12 @@ 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 +openstackdocs_repo_name = 'openstack/swift' +openstackdocs_bug_project = 'swift' +openstackdocs_bug_tag = 'api-ref' # -- Options for man page output ---------------------------------------------- @@ -152,25 +141,6 @@ pygments_style = 'sphinx' # 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' -if 'SOURCE_DATE_EPOCH' in os.environ: - now = float(os.environ.get('SOURCE_DATE_EPOCH')) - html_last_updated_fmt = datetime.datetime.utcfromtimestamp(now).isoformat() -else: - git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", - "--date=local", "-n1"] - try: - html_last_updated_fmt = subprocess.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] - except OSError: - warnings.warn('Cannot get last updated time from git repository. ' - 'Not setting "html_last_updated_fmt".') - else: - if not isinstance(html_last_updated_fmt, str): - # for py3 - html_last_updated_fmt = html_last_updated_fmt.decode('ascii') # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True |