From c3806b8b688732472599502c641157f2f207b44b Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Wed, 4 Sep 2019 08:32:33 +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: 2006123 Task: 35520 Change-Id: Ia148f2959f30e098c7693396ba1d6d633e4ef198 --- doc/source/conf.py | 22 +++++++++++++++++----- tox.ini | 10 ++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9a0feed..1c04ee3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -37,7 +37,6 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'Tacker-Horizon' copyright = u'2018, OpenStack Developers' # openstackdocstheme options @@ -66,16 +65,18 @@ pygments_style = 'sphinx' html_theme = 'openstackdocs' # Output file base name for HTML help builder. -htmlhelp_basename = '%sdoc' % project +htmlhelp_basename = 'tacker-horizon' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). +# NOTE(vishalmanchanda): Specify toctree_only=True for a better document +# structure of the generated PDF file. latex_documents = [ ('index', - '%s.tex' % project, - u'%s Documentation' % project, - u'OpenStack Developers', 'manual'), + 'doc-tacker-horizon.tex', + u'Tacker-Horizon Documentation', + u'OpenStack Developers', 'howto', True), ] man_pages = [ @@ -87,3 +88,14 @@ man_pages = [ # Example configuration for intersphinx: refer to the Python standard library. # intersphinx_mapping = {'http://docs.python.org/': None} + +# 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}', +} diff --git a/tox.ini b/tox.ini index 5ce9724..f170979 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,16 @@ basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html +[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:cover] basepython = python3 commands =