Build pdf doc

The is one of community goals that each project could produce a
single PDF file. The pdf should be in the output of openstack-tox-docs
job.

TeX packages are required to build PDF locally, following is recommended:

* inkscape
* texlive-latex-base
* texlive-latex-extra
* texlive-fonts-recommended

More about the goal:
https://governance.openstack.org/tc/goals/train/pdf-doc-generation.html
https://etherpad.openstack.org/p/train-pdf-support-goal
https://etherpad.openstack.org/p/pdf-goal-train-common-problems

Change-Id: I83f264f58543ae90a941afd37567eeb46b4acfcc
This commit is contained in:
Kaifeng Wang 2019-06-21 16:42:20 +08:00
parent 2cd0a230a6
commit d95a4cd30f
4 changed files with 19 additions and 16 deletions

View File

@ -3,3 +3,4 @@ sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
openstackdocstheme>=1.20.0 # Apache-2.0 openstackdocstheme>=1.20.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
sphinxcontrib-apidoc>=0.2.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

View File

@ -7,17 +7,12 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinxcontrib.apidoc', extensions = ['sphinxcontrib.apidoc',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'sphinxcontrib.rsvgconverter',
'openstackdocstheme',
] ]
try:
import openstackdocstheme
extensions.append('openstackdocstheme')
except ImportError:
openstackdocstheme = None
repository_name = 'openstack/python-ironic-inspector-client' repository_name = 'openstack/python-ironic-inspector-client'
bug_project = 'python-ironic-inspector-client' use_storyboard = True
bug_tag = ''
wsme_protocols = ['restjson'] wsme_protocols = ['restjson']
@ -41,7 +36,6 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Ironic Inspector Client'
copyright = u'OpenStack Foundation' copyright = u'OpenStack Foundation'
# A list of ignored prefixes for module index sorting. # A list of ignored prefixes for module index sorting.
@ -61,17 +55,15 @@ pygments_style = 'sphinx'
# 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
# Sphinx are currently 'default' and 'sphinxdoc'. # Sphinx are currently 'default' and 'sphinxdoc'.
if openstackdocstheme is not None: html_theme = 'openstackdocs'
html_theme = 'openstackdocs'
else:
html_theme = 'default'
#html_theme_path = ["."] #html_theme_path = ["."]
#html_theme = '_theme' #html_theme = '_theme'
#html_static_path = ['_static'] #html_static_path = ['_static']
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project htmlhelp_basename = 'python-ironic-inspector-clientdoc'
latex_use_xindy = False
# 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
@ -79,8 +71,8 @@ htmlhelp_basename = '%sdoc' % project
latex_documents = [ latex_documents = [
( (
'index', 'index',
'%s.tex' % project, 'doc-python-ironic-inspector-client.tex',
u'%s Documentation' % project, u'Python Ironic Inspector Client Documentation',
u'OpenStack Foundation', u'OpenStack Foundation',
'manual' 'manual'
), ),

View File

@ -76,6 +76,7 @@ simplejson==3.5.1
six==1.10.0 six==1.10.0
snowballstemmer==1.2.1 snowballstemmer==1.2.1
Sphinx==1.6.2 Sphinx==1.6.2
sphinxcontrib-svg2pdfconverter==0.1.0
sphinxcontrib-websupport==1.0.1 sphinxcontrib-websupport==1.0.1
stevedore==1.20.0 stevedore==1.20.0
testtools==2.2.0 testtools==2.2.0

View File

@ -13,6 +13,7 @@ commands =
coverage run --branch --include "ironic_inspector_client*" -m unittest discover ironic_inspector_client.test coverage run --branch --include "ironic_inspector_client*" -m unittest discover ironic_inspector_client.test
coverage report -m --fail-under 90 coverage report -m --fail-under 90
setenv = PYTHONDONTWRITEBYTECODE=1 setenv = PYTHONDONTWRITEBYTECODE=1
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3
@ -70,6 +71,14 @@ deps =
-r{toxinidir}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
whitelist_externals = make
deps = {[testenv:docs]deps}
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[flake8] [flake8]
import-order-style = pep8 import-order-style = pep8
application-import-names = ironic_inspector_client application-import-names = ironic_inspector_client