From 3349e897b9835c91f9fa75e8a6c9770e8abea890 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Thu, 10 Sep 2020 14:32:06 +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: 35470 Change-Id: Id93200ae85c25dfb713e96a09d2ee4aea611ed33 --- doc/source/conf.py | 9 ++++++++- requirements.txt | 1 + tox.ini | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 2f271a7..329f43b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -31,6 +31,7 @@ import os extensions = [ 'sphinx.ext.todo', 'sphinx.ext.viewcode', + 'sphinxcontrib.rsvgconverter', 'openstackdocstheme', 'yasfb', ] @@ -68,6 +69,7 @@ copyright = u'%s, OpenStack QA Team' % datetime.date.today().year # openstackdocstheme options openstackdocs_repo_name = 'openstack/qa-specs' openstackdocs_auto_name = False +openstackdocs_pdf_link = True # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -188,10 +190,15 @@ htmlhelp_basename = 'QA-Specsdoc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'QA-specs.tex', u'QA Specs', + ('index', 'doc-qa-specs.tex', u'QA Specs Documentation', u'OpenStack QA 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/requirements.txt b/requirements.txt index 3e043d1..f65fcfa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ docutils>=0.11,!=0.13.1 # OSI-Approved Open Source, Public Domain sphinx>=2.0.0,!=2.1.0 # BSD yasfb>=0.5.1 openstackdocstheme>=2.2.1 # Apache-2.0 +sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD diff --git a/tox.ini b/tox.ini index 8ad0f65..d283b86 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,13 @@ commands = {posargs} [testenv:docs] commands = sphinx-build -W -b html doc/source doc/build/html +[testenv:pdf-docs] +whitelist_externals = + make +commands = + sphinx-build -W -b latex doc/source doc/build/pdf + make -C doc/build/pdf + [testenv:spelling] deps = -r{toxinidir}/requirements.txt