Generate PDF documentation

This commit adds a new tox target to build PDF documentation.
It's a part of community goal, see storyboard for more
information.

Change-Id: I04b9253ae30ec125e45a272f0c7ce384c7770372
Story: 2006076
Task: 35607
This commit is contained in:
whoami-rajat 2019-09-17 13:53:57 +05:30
parent f66683c01c
commit eca15c1c40
3 changed files with 30 additions and 3 deletions

2
doc/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
openstackdocstheme>=1.30.0 # Apache-2.0
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

View File

@ -23,6 +23,7 @@ extensions = [
'sphinx.ext.autodoc',
# 'sphinx.ext.intersphinx',
'openstackdocstheme',
'sphinxcontrib.rsvgconverter'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -64,14 +65,27 @@ htmlhelp_basename = '%sdoc' % project
# html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
latex_use_xindy = False
latex_domain_indices = False
latex_elements = {
'makeindex': '',
'printindex': '',
'preamble': r'\setcounter{tocdepth}{3}',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
# NOTE: Specify toctree_only=True for a better document structure of
# the generated PDF file.
latex_documents = [
('index',
'%s.tex' % project,
'doc-%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
u'OpenStack Foundation', 'manual', True),
]
# Example configuration for intersphinx: refer to the Python standard library.

13
tox.ini
View File

@ -59,7 +59,18 @@ commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
envdir = {toxworkdir}/docs
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[flake8]
# E123, E125 skipped as they are invalid PEP-8.