From f46106c2f54d7993bb9f34ce733e0bec8f42bbef Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Thu, 17 Sep 2020 10:52:42 +0200 Subject: [PATCH] Create tox environment to build pdf documentation This patch enables building .pdf documentation using new 'pdf-docs' tox environment. The newly created tox environment creates latex source codes using sphinx-build and then builds the pdf documentation using make. Story: 2006070 Task: 35467 Change-Id: Ie2b3df9f09445ca4f71bb1fbf69c92a4d7b3e719 --- doc/source/conf.py | 11 +++++++++-- tox.ini | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 23824d8..aa2c708 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -30,6 +30,7 @@ openstackdocs_repo_name = 'openstack/os-performance-tools' openstackdocs_auto_name = False openstackdocs_bug_project = 'os-performance-tools' openstackdocs_bug_tag = '' +openstackdocs_pdf_link = True html_theme = 'openstackdocs' @@ -82,10 +83,16 @@ htmlhelp_basename = '%sdoc' % project # [howto/manual]). latex_documents = [ ('index', - '%s.tex' % project, - u'%s Documentation' % project, + 'doc-%s.tex' % project, + u'Os-performance-tools Documentation', u'OpenStack Foundation', 'manual'), ] # Example configuration for intersphinx: refer to the Python standard library. #intersphinx_mapping = {'http://docs.python.org/': None} + +latex_use_xindy = False +latex_elements = { + 'extraclassoptions': 'openany,oneside', + 'maxlistdepth': 10 +} diff --git a/tox.ini b/tox.ini index b23a43a..55124b6 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,14 @@ deps = commands = sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html +[testenv:pdf-docs] +deps = {[testenv:docs]deps} +whitelist_externals = + make +commands = + sphinx-build -W -b latex doc/source doc/build/pdf + make -C doc/build/pdf + [testenv:debug] commands = oslo_debug_helper {posargs}