From 2381d9112dc4f2737cea3712311193d262165d40 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Thu, 10 Sep 2020 17:05:33 +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: 35460 Change-Id: I1f0ca39747e8ef95d2b93cd00214911d4a7408a9 --- doc/source/conf.py | 6 +++++- doc/source/index.rst | 2 -- tox.ini | 8 ++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 56cf692..63e4bc5 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -34,6 +34,7 @@ extensions = ['sphinx.ext.autodoc', openstackdocs_repo_name = 'openstack/devstack-tools' openstackdocs_bug_project = 'devstack-tools' openstackdocs_bug_tag = 'doc' +openstackdocs_pdf_link = True # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. @@ -141,9 +142,12 @@ suppress_warnings = ['image.nonlocal_uri'] # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ - ('index', 'doc-tempest.tex', u'Tempest Testing Project', + ('index', 'doc-devstack-tools.tex', u'Devstack-tools Documentation', u'OpenStack Foundation', 'manual'), ] # Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664 latex_use_xindy = False +latex_elements = { + 'extraclassoptions': 'openany,oneside', +} diff --git a/doc/source/index.rst b/doc/source/index.rst index 98f5e67..6b32290 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,8 +6,6 @@ Welcome to devstack-tools's documentation! ======================================================== -Contents: - .. toctree:: :maxdepth: 2 diff --git a/tox.ini b/tox.ini index ffaaf58..6cf3ddb 100644 --- a/tox.ini +++ b/tox.ini @@ -34,6 +34,14 @@ commands = sphinx-build -W -b html doc/source doc/build/html whitelist_externals = rm +[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:releasenotes] deps = {[testenv:docs]deps} commands =