From e0646979892bef3d1c3162aa09df3bd7722936c3 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Wed, 4 Sep 2019 18:08:15 +0000 Subject: [PATCH] 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. Story: 2006083 Task: 34856 --- doc/requirements.txt | 1 + doc/source/conf.py | 18 +++++++++++++++--- tox.ini | 10 ++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 5afd3b86..32116d42 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,3 +7,4 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD reno>=2.5.0 # Apache-2.0 sphinxcontrib-httpdomain>=1.3.0 # BSD +sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index b37a7b81..dc069028 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -24,6 +24,7 @@ extensions = [ 'sphinx.ext.autodoc', 'openstackdocstheme', # 'sphinx.ext.intersphinx', + 'sphinxcontrib.rsvgconverter', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy @@ -73,11 +74,22 @@ htmlhelp_basename = '%sdoc' % project # [howto/manual]). latex_documents = [ ('index', - '%s.tex' % project, - u'%s Documentation' % project, - u'OpenStack Developers', 'manual'), + 'doc-heat-dashboard.tex', + u'Heat Dashboard Documentation', + u'OpenStack Developers', 'manual', True), ] +latex_domain_indices = False + +latex_elements = { + # Additional stuff for the LaTeX preamble. + # openany: Skip blank pages in generated PDFs + 'extraclassoptions': 'openany,oneside', + 'makeindex': '', + 'printindex': '', + 'preamble': r'\setcounter{tocdepth}{3}', +} + man_pages = [ ('index', u'Heat Dashboard Documentation', 'Documentation for Heat Dashboard plugin to Openstack\ diff --git a/tox.ini b/tox.ini index fcf25029..a9fa91ac 100644 --- a/tox.ini +++ b/tox.ini @@ -61,6 +61,16 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/ -r{toxinidir}/doc/requirements.txt commands = python setup.py build_sphinx +[testenv:pdf-docs] +basepython = python3 +envdir = {toxworkdir}/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:releasenotes] basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}