Generate PDF documentation

Change-Id: If69b232cc2174bf00be4314dd71085100f4e951c
Story: 2006101
Task: 35149
This commit is contained in:
Michael Johnson 2019-09-13 10:48:05 -07:00
parent 7140479919
commit 791fefbf4e
6 changed files with 139 additions and 28 deletions

View File

@ -1,4 +1,7 @@
======================== ======================
Octavia Tempest Plugin
======================
Team and repository tags Team and repository tags
======================== ========================
@ -7,7 +10,6 @@ Team and repository tags
.. Change things from this point on .. Change things from this point on
==============================
Tempest integration of Octavia Tempest integration of Octavia
============================== ==============================

View File

@ -9,3 +9,6 @@ openstackdocstheme>=1.18.1 # Apache-2.0
# releasenotes # releasenotes
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
# PDF Docs
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import datetime
import os import os
import sys import sys
@ -29,7 +30,8 @@ extensions = [
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'openstackdocstheme', 'openstackdocstheme',
'oslo_config.sphinxext', 'oslo_config.sphinxext',
'sphinxcontrib.apidoc' 'sphinxcontrib.apidoc',
'sphinxcontrib.rsvgconverter'
] ]
# autodoc generation is a bit aggressive and a nuisance when doing heavy # autodoc generation is a bit aggressive and a nuisance when doing heavy
@ -45,7 +47,17 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'octavia-tempest-plugin' 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. # If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True add_function_parentheses = True
@ -60,6 +72,14 @@ pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting. # A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['octavia_tempest_plugin.'] 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 -------------------------------------------------- # -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with # The theme to use for HTML and HTML Help pages. Major themes that come with
@ -81,23 +101,66 @@ html_domain_indices = True
# If false, no index is generated. # If false, no index is generated.
html_use_index = True 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 # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass # (source start file, target name, title, author, documentclass
# [howto/manual]). # [howto/manual]).
latex_documents = [ latex_documents = [(
('index', 'index',
'%s.tex' % project, 'doc-octavia-tempest-plugin.tex',
u'%s Documentation' % project, u'Octavia Tempest Plugin Documentation',
u'OpenStack Foundation', 'manual'), u'OpenStack Octavia Team',
] 'manual'
)]
# Example configuration for intersphinx: refer to the Python standard library. # The name of an image file (relative to this directory) to place at the top of
#intersphinx_mapping = {'http://docs.python.org/': None} # the title page.
# latex_logo = None
repository_name = 'openstack/octavia-tempest-plugin' # For "manual" documents, if this is true, then toplevel headings are parts,
bug_project = '910' # not chapters.
bug_tag = 'docs' # latex_use_parts = False
apidoc_output_dir = '_build/modules' # If true, show page references after internal links.
apidoc_module_dir = '../../octavia_tempest_plugin' # latex_show_pagerefs = False
apidoc_excluded_paths = []
# 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

View File

@ -6,8 +6,6 @@
Welcome to octavia-tempest-plugin's documentation! Welcome to octavia-tempest-plugin's documentation!
================================================== ==================================================
Contents:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@ -16,14 +14,16 @@ Contents:
contributing contributing
configref configref
Indices and tables .. only:: html
==================
.. toctree:: Indices and tables
:hidden: ------------------
_build/modules/modules .. toctree::
:hidden:
* :ref:`genindex` _build/modules/modules
* :ref:`modindex`
* :ref:`search` * :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -0,0 +1,32 @@
# Copyright 2011-2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pbr.version
OCTAVIA_TEMPEST_VENDOR = "OpenStack Foundation"
OCTAVIA_TEMPEST_PRODUCT = "OpenStack Octavia tempest plugin"
version_info = pbr.version.VersionInfo('octavia-tempest-plugin')
def vendor_string():
return OCTAVIA_TEMPEST_VENDOR
def product_string():
return OCTAVIA_TEMPEST_PRODUCT
def version_string_with_package():
return version_info.version_string()

11
tox.ini
View File

@ -49,6 +49,17 @@ commands =
rm -rf doc/build rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals =
make
rm
commands =
rm -rf doc/build/pdf
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3 basepython = python3
deps = deps =