PDF Documentation Build tox target

This patch adds a `pdf-docs` tox target that will build
PDF versions of our docs. As per the Train community goal:

  https://governance.openstack.org/tc/goals/selected/train/pdf-doc-generation.html

Add sphinxcontrib-svg2pdfconverter to doc/requirements.txt
to convert our SVGs.

Change-Id: I3435e2ec962b8cc06d520cd818adc3bb9c7173ea
Story: 2006105
This commit is contained in:
Dmitriy Rabotyagov 2019-10-18 17:13:04 +03:00
parent bfb99d823d
commit 2f1b789e06
5 changed files with 29 additions and 5 deletions

View File

@ -10,7 +10,8 @@
# automatically be proposed to all the repositories which use it. # automatically be proposed to all the repositories which use it.
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD sphinx>=1.8.0,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # 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
doc8>=0.6.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0

View File

View File

@ -38,6 +38,7 @@
extensions = [ extensions = [
'openstackdocstheme', 'openstackdocstheme',
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinxcontrib.rsvgconverter',
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
@ -61,7 +62,7 @@ copyright = '2014-2016, OpenStack-Ansible Contributors'
description = 'OpenStack-Ansible deploys OpenStack environments using Ansible.' description = 'OpenStack-Ansible deploys OpenStack environments using Ansible.'
role_name = 'os_neutron' role_name = 'os_neutron'
target_name = 'openstack-ansible-' + role_name target_name = 'openstack-ansible-' + role_name
title = 'OpenStack-Ansible Documentation: ' + role_name + 'role' title = 'OpenStack-Ansible Documentation: ' + role_name + ' role'
# The link to the browsable source code (for the left hand menu) # The link to the browsable source code (for the left hand menu)
oslosphinx_cgit_link = ( oslosphinx_cgit_link = (
@ -217,10 +218,12 @@ htmlhelp_basename = target_name + '-docs'
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, target_name + '.tex', (master_doc, 'doc-' + target_name + '.tex',
title, author, 'manual'), title.replace("_", "\_"), author, 'manual'),
] ]
latex_use_xindy = False
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
# the title page. # the title page.
# latex_logo = None # latex_logo = None
@ -277,3 +280,11 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False # texinfo_no_detailmenu = False
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
(master_doc, target_name,
title, author)
]
locale_dirs = ['locale/']

View File

@ -8,6 +8,8 @@ Neutron role for OpenStack-Ansible
configure-network-services.rst configure-network-services.rst
app-openvswitch.rst app-openvswitch.rst
app-openvswitch-asap.rst app-openvswitch-asap.rst
app-openvswitch-dvr.rst
app-openvswitch-sfc.rst
app-ovn.rst app-ovn.rst
app-nuage.rst app-nuage.rst
app-calico.rst app-calico.rst

12
tox.ini
View File

@ -36,11 +36,21 @@ setenv =
[testenv:docs] [testenv:docs]
basepython = python3 basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands= commands =
bash -c "rm -rf doc/build" bash -c "rm -rf doc/build"
sphinx-build -b html doc/source doc/build/html sphinx-build -b html doc/source doc/build/html
[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[doc8] [doc8]
# Settings for doc8: # Settings for doc8:
extensions = .rst extensions = .rst