From e0405ceff6d3499e8f3786df9d678ffaab6ad95f Mon Sep 17 00:00:00 2001 From: licanwei Date: Tue, 17 Sep 2019 01:26:17 -0700 Subject: [PATCH] Build pdf docs Add a new pdf-docs environment to enable PDF build. Change-Id: I9691132f542242716992d2f842f1261b7cd30389 --- doc/requirements.txt | 7 +++++++ doc/source/conf.py | 13 ++++++++++++- doc/source/contributor/index.rst | 2 +- doc/source/install/index.rst | 2 +- tox.ini | 16 ++++++++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..71d9dcd --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,7 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +openstackdocstheme>=1.18.1 # Apache-2.0 +sphinx!=1.6.6,!=1.6.7,>=1.6.5,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.5;python_version>='3.4' # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 4d8bb80..56e2547 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -96,11 +96,22 @@ htmlhelp_basename = '%sdoc' % project # [howto/manual]). latex_documents = [ ('index', - '%s.tex' % project, + 'doc-watcher-dashboard.tex', u'%s Documentation' % project, u'OpenStack Foundation', 'manual'), ] +# 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}', +} + # Example configuration for intersphinx: refer to the Python standard library. # intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst index e4506d5..bd6b922 100644 --- a/doc/source/contributor/index.rst +++ b/doc/source/contributor/index.rst @@ -1,4 +1,4 @@ .. toctree:: :maxdepth: 1 - contributing \ No newline at end of file + contributing diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index ac607b3..9590465 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -1,4 +1,4 @@ .. toctree:: :maxdepth: 1 - installation \ No newline at end of file + installation diff --git a/tox.ini b/tox.ini index 3f44b33..c31602d 100644 --- a/tox.ini +++ b/tox.ini @@ -53,8 +53,24 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' [testenv:docs] basepython = python3 +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/requirements.txt + -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 = + rm + make +commands = + rm -rf doc/build/pdf + sphinx-build -W -b latex doc/source doc/build/pdf + make -C doc/build/pdf + [testenv:debug] basepython = python3 commands = oslo_debug_helper {posargs}