From 7e12fcc0bec7a4063304fb8349b496b50ad40d1a Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Thu, 17 Sep 2020 14:09:34 +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: 35463 Change-Id: Ie5f522d0561d52206eabf400f4a53f67a8997eca --- doc/source/conf.py | 8 +++++++- tox.ini | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index ad78429e..bf328424 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -94,6 +94,7 @@ modindex_common_prefix = ['Grenade-doc.'] openstackdocs_repo_name = 'openstack/grenade' openstackdocs_bug_project = 'grenade' openstackdocs_bug_tag = 'docs' +openstackdocs_pdf_link = True # -- Options for man page output ---------------------------------------------- man_pages = [] @@ -174,10 +175,15 @@ htmlhelp_basename = 'Grenade-doc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Grenade-doc.tex', u'Grenade Docs', + ('index', 'doc-grenade.tex', u'Grenade Docs', u'OpenStack Grenade Team', 'manual'), ] +latex_use_xindy = False +latex_elements = { + 'extraclassoptions': 'openany,oneside', +} + # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None diff --git a/tox.ini b/tox.ini index 484e7034..5b07c2e1 100644 --- a/tox.ini +++ b/tox.ini @@ -29,3 +29,11 @@ setenv = commands = sphinx-build -W -b html doc/source doc/build/html bash tools/build_docs.sh + +[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