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

Change-Id: Iefa8795ba985f502f952001cdc616dae20847ef9
This commit is contained in:
Lukas Piwowarski 2020-09-16 15:07:06 +02:00
parent 6506c4d406
commit 4f14a185aa
3 changed files with 20 additions and 4 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

@ -13,6 +13,7 @@
extensions = [
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinxcontrib.rsvgconverter',
'openstackdocstheme'
]
@ -38,6 +39,7 @@ copyright = u'2015-2019, OpenStack Foundation'
openstackdocs_repo_name = 'openstack/openstack-health'
openstackdocs_bug_project = 'openstack-health'
openstackdocs_bug_tag = ''
openstackdocs_pdf_link = True
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -161,15 +163,22 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'openstack-health.tex', u'OpenStack-Health Documentation',
('index', 'doc-openstack-health.tex', u'OpenStack-Health Documentation',
u'OpenStack Foundation', '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

12
tox.ini
View File

@ -19,14 +19,20 @@ commands =
commands = {posargs}
[testenv:docs]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
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:pep8]
commands =
flake8 {toxinidir}/openstack_health {posargs}