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: 35468

Change-Id: I1d1448153fceece36470547b5f1b646e194dc51d
This commit is contained in:
Lukas Piwowarski 2020-09-09 16:34:34 +02:00
parent f3f45e81b8
commit 9bb54d2366
3 changed files with 28 additions and 2 deletions

View File

@ -4,3 +4,4 @@
openstackdocstheme>=2.2.1 # Apache-2.0
reno>=3.1.0 # Apache-2.0
sphinx>=2.0.0,!=2.1.0 # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

View File

@ -23,7 +23,8 @@ sys.path.insert(0, os.path.abspath('../..'))
extensions = [
'sphinx.ext.autodoc',
# 'sphinx.ext.intersphinx',
'openstackdocstheme'
'openstackdocstheme',
'sphinxcontrib.rsvgconverter'
]
# openstackdocstheme options
@ -31,6 +32,7 @@ openstackdocs_repo_name = 'openstack/os-testr'
openstackdocs_auto_name = False
openstackdocs_bug_project = 'os-testr'
openstackdocs_bug_tag = ''
openstackdocs_pdf_link = True
# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
@ -90,3 +92,19 @@ man_pages = [('ostestr', 'ostestr', 'tooling to run OpenStack tests',
# Example configuration for intersphinx: refer to the Python standard library.
# intersphinx_mapping = {'http://docs.python.org/': None}
# -- Options for LaTeX output -------------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
('index', 'doc-os-testr.tex', u'Os-testr',
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'
}

View File

@ -41,11 +41,18 @@ commands =
[testenv:docs]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W --keep-going -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}