From 80ee534f4084180b5769ec2083c902613a0457b7 Mon Sep 17 00:00:00 2001 From: sunjia Date: Thu, 3 Oct 2019 17:29:04 +0800 Subject: [PATCH] Generate PDF documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For PDFLaTeX, remove the irrelevant parts (contributing, search). Change-Id: I78e2baa51a523ef4e8b76a5f7b2ad5cda1085b8a Co-Authored-By: Radosław Piliszek --- doc/source/conf.py | 19 ++++++++++++------- doc/source/index.rst | 23 ++++++++++++----------- tox.ini | 8 ++++++++ 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 7798d83..487dfa5 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -27,6 +27,11 @@ extensions = [ 'oslo_config.sphinxext', ] +# sphinxcontrib.apidoc options +config_generator_config_file = ( + '../../etc/masakarimonitors/masakarimonitors-config-generator.conf') +sample_config_basename = '_static/masakarimonitors' + # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable @@ -65,20 +70,20 @@ openstackdocs_bug_project = 'masakari-monitors' # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project +# -- Options for LaTeX output ------------------------------------------------- + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', - '%s.tex' % project, + 'doc-%s.tex' % project, '%s Documentation' % project, 'OpenStack Foundation', 'manual'), ] -# 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 -# sphinxcontrib.apidoc options -config_generator_config_file = ( - '../../etc/masakarimonitors/masakarimonitors-config-generator.conf') -sample_config_basename = '_static/masakarimonitors' +# Disable smartquotes, they don't work in latex +smartquotes_excludes = {'builders': ['latex']} diff --git a/doc/source/index.rst b/doc/source/index.rst index 4336173..8bf063c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -17,20 +17,21 @@ Contents: reference/conf reference/conf-file -For Contributors -================ +.. only:: html -* If you are a new contributor to Masakari Monitors please refer: :doc:`contributor/contributing` + For Contributors + ================ - .. toctree:: - :hidden: + * If you are a new contributor to Masakari Monitors please refer: :doc:`contributor/contributing` - contributor/contributing + .. toctree:: + :hidden: -Indices and tables -================== + contributor/contributing -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` + Indices and tables + ================== + * :ref:`genindex` + * :ref:`modindex` + * :ref:`search` diff --git a/tox.ini b/tox.ini index 7a56983..e38c613 100644 --- a/tox.ini +++ b/tox.ini @@ -43,6 +43,14 @@ deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html +[testenv:pdf-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] deps = {[testenv:docs]deps} commands =