Skip to content

Commit 296fd22

Browse files
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: I6e4f6372ff026a9eb379ee06c683451f58a99976 Story: 2006075 Task: 34812
1 parent c8d7a9e commit 296fd22

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
openstackdocstheme>=1.30.0 # Apache-2.0
66
sphinx>=1.6.2,!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
77
sphinx>=1.6.2,!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD
8+
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD
89
reno>=2.5.0 # Apache-2.0

doc/source/conf.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'cliff.sphinxext',
2424
'sphinx.ext.autodoc',
2525
'openstackdocstheme',
26+
'sphinxcontrib.rsvgconverter',
2627
]
2728

2829
autoprogram_cliff_ignored = [
@@ -74,14 +75,30 @@
7475
# Output file base name for HTML help builder.
7576
htmlhelp_basename = '%sdoc' % project
7677

78+
79+
# -- Options for LaTeX output ---------------------------------------------
80+
81+
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
82+
latex_use_xindy = False
83+
84+
latex_domain_indices = False
85+
86+
latex_elements = {
87+
'makeindex': '',
88+
'printindex': '',
89+
'preamble': r'\setcounter{tocdepth}{3}',
90+
}
91+
7792
# Grouping the document tree into LaTeX files. List of tuples
7893
# (source start file, target name, title, author, documentclass
7994
# [howto/manual]).
95+
# NOTE: Specify toctree_only=True for a better document structure of
96+
# the generated PDF file.
8097
latex_documents = [
8198
('index',
82-
'%s.tex' % project,
99+
'doc-%s.tex' % project,
83100
u'%s Documentation' % project,
84-
u'OpenStack Foundation', 'manual'),
101+
u'OpenStack Foundation', 'howto', True),
85102
]
86103

87104
# Example configuration for intersphinx: refer to the Python standard library.

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ basepython = python3
5151
deps = -r{toxinidir}/doc/requirements.txt
5252
commands = sphinx-build -W -b html doc/source doc/build/html
5353

54+
[testenv:pdf-docs]
55+
basepython = python3
56+
envdir = {toxworkdir}/docs
57+
deps = {[testenv:docs]deps}
58+
whitelist_externals =
59+
make
60+
commands =
61+
sphinx-build -W -b latex doc/source doc/build/pdf
62+
make -C doc/build/pdf
63+
5464
[flake8]
5565
# E123, E125 skipped as they are invalid PEP-8.
5666

0 commit comments

Comments
 (0)