Generate PDF documentation
Change-Id: If69b232cc2174bf00be4314dd71085100f4e951c
Story: 2006101
Task: 35149
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 2d5c49f..5bbe295 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import datetime
import os
import sys
@@ -29,7 +30,8 @@
'sphinx.ext.viewcode',
'openstackdocstheme',
'oslo_config.sphinxext',
- 'sphinxcontrib.apidoc'
+ 'sphinxcontrib.apidoc',
+ 'sphinxcontrib.rsvgconverter'
]
# autodoc generation is a bit aggressive and a nuisance when doing heavy
@@ -45,7 +47,17 @@
# General information about the project.
project = u'octavia-tempest-plugin'
-copyright = u'2017, OpenStack Foundation'
+copyright = u'2017-2019, OpenStack Foundation'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# Version info
+from octavia_tempest_plugin.version import version_info as octavia_tempest_ver
+release = octavia_tempest_ver.release_string()
+# The short X.Y version.
+version = octavia_tempest_ver.version_string()
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@@ -60,6 +72,14 @@
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['octavia_tempest_plugin.']
+repository_name = 'openstack/octavia-tempest-plugin'
+bug_project = '910'
+bug_tag = 'docs'
+
+apidoc_output_dir = '_build/modules'
+apidoc_module_dir = '../../octavia_tempest_plugin'
+apidoc_excluded_paths = []
+
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
@@ -81,23 +101,66 @@
# If false, no index is generated.
html_use_index = True
+# -- Options for LaTeX output -------------------------------------------------
+
+# Fix Unicode character for sphinx_feature_classification
+# Sphinx default latex engine (pdflatex) doesn't know much unicode
+latex_preamble = r"""
+\usepackage{newunicodechar}
+\newunicodechar{✖}{\sffamily X}
+\setcounter{tocdepth}{2}
+\authoraddress{\textcopyright %s OpenStack Foundation}
+""" % datetime.datetime.now().year
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ # openany: Skip blank pages in generated PDFs
+ 'extraclassoptions': 'openany,oneside',
+ 'makeindex': '',
+ 'printindex': '',
+ 'preamble': latex_preamble
+}
+
+# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
+# Some distros are missing xindy
+latex_use_xindy = False
+
+# Fix missing apostrophe
+smartquotes_excludes = {'builders': ['latex']}
+
# 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,
- u'%s Documentation' % project,
- u'OpenStack Foundation', 'manual'),
-]
+latex_documents = [(
+ 'index',
+ 'doc-octavia-tempest-plugin.tex',
+ u'Octavia Tempest Plugin Documentation',
+ u'OpenStack Octavia Team',
+ 'manual'
+)]
-# Example configuration for intersphinx: refer to the Python standard library.
-#intersphinx_mapping = {'http://docs.python.org/': None}
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+# latex_logo = None
-repository_name = 'openstack/octavia-tempest-plugin'
-bug_project = '910'
-bug_tag = 'docs'
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+# latex_use_parts = False
-apidoc_output_dir = '_build/modules'
-apidoc_module_dir = '../../octavia_tempest_plugin'
-apidoc_excluded_paths = []
+# If true, show page references after internal links.
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+# latex_appendices = []
+
+# If false, no module index is generated.
+latex_domain_indices = False
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 494a0b6..b991832 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -6,8 +6,6 @@
Welcome to octavia-tempest-plugin's documentation!
==================================================
-Contents:
-
.. toctree::
:maxdepth: 2
@@ -16,14 +14,16 @@
contributing
configref
-Indices and tables
-==================
+.. only:: html
-.. toctree::
- :hidden:
+ Indices and tables
+ ------------------
- _build/modules/modules
+ .. toctree::
+ :hidden:
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+ _build/modules/modules
+
+ * :ref:`genindex`
+ * :ref:`modindex`
+ * :ref:`search`