PDF Documentation Build tox target

Change-Id: I54e3d3d6fbe0b753597703b6e61f884703c4e7e7
Signed-off-by: sonpn13 <sonpn13@viettel.com.vn>
Story: 2006105
Task: 35341
This commit is contained in:
sonpn13 2019-10-27 08:59:23 +07:00 committed by Marc Gariepy
parent f4cae325f9
commit 018e06a5f9
3 changed files with 38 additions and 3 deletions

16
doc/requirements.txt Normal file
View File

@ -0,0 +1,16 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# WARNING:
# This file is maintained in the openstack-ansible-tests repository.
# https://opendev.org/openstack/openstack-ansible-tests/src/branch/master/sync/doc/requirements.txt
# If you need to modify this file, update the one in the
# openstack-ansible-tests repository. Once it merges there, the changes will
# automatically be proposed to all the repositories which use it.
sphinx>=2.0.0,!=2.1.0 # BSD
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD
openstackdocstheme>=2.2.1 # Apache-2.0
reno>=3.1.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0

View File

@ -37,6 +37,8 @@
# ones.
extensions = [
'openstackdocstheme',
'sphinx.ext.autodoc',
'sphinxcontrib.rsvgconverter',
]
# Add any paths that contain templates here, relative to this directory.
@ -228,8 +230,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, target_name + '.tex',
title, author, 'manual'),
(master_doc, 'doc-' + target_name + '.tex',
title.replace("_", r"\_"), author, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -288,3 +290,11 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
(master_doc, target_name,
title, author)
]
locale_dirs = ['locale/']

11
tox.ini
View File

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