Browse Source

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
tags/3.7.0^0
Kaifeng Wang 3 months ago
parent
commit
d95a4cd30f
4 changed files with 19 additions and 16 deletions
  1. 1
    0
      doc/requirements.txt
  2. 8
    16
      doc/source/conf.py
  3. 1
    0
      lower-constraints.txt
  4. 9
    0
      tox.ini

+ 1
- 0
doc/requirements.txt View File

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

+ 8
- 16
doc/source/conf.py View File

@@ -7,17 +7,12 @@
7 7
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
8 8
 extensions = ['sphinxcontrib.apidoc',
9 9
               'sphinx.ext.viewcode',
10
+              'sphinxcontrib.rsvgconverter',
11
+              'openstackdocstheme',
10 12
               ]
11 13
 
12
-try:
13
-    import openstackdocstheme
14
-    extensions.append('openstackdocstheme')
15
-except ImportError:
16
-    openstackdocstheme = None
17
-
18 14
 repository_name = 'openstack/python-ironic-inspector-client'
19
-bug_project = 'python-ironic-inspector-client'
20
-bug_tag = ''
15
+use_storyboard = True
21 16
 
22 17
 wsme_protocols = ['restjson']
23 18
 
@@ -41,7 +36,6 @@ source_suffix = '.rst'
41 36
 master_doc = 'index'
42 37
 
43 38
 # General information about the project.
44
-project = u'Ironic Inspector Client'
45 39
 copyright = u'OpenStack Foundation'
46 40
 
47 41
 # A list of ignored prefixes for module index sorting.
@@ -61,17 +55,15 @@ pygments_style = 'sphinx'
61 55
 
62 56
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
63 57
 # Sphinx are currently 'default' and 'sphinxdoc'.
64
-if openstackdocstheme is not None:
65
-    html_theme = 'openstackdocs'
66
-else:
67
-    html_theme = 'default'
58
+html_theme = 'openstackdocs'
68 59
 #html_theme_path = ["."]
69 60
 #html_theme = '_theme'
70 61
 #html_static_path = ['_static']
71 62
 
72 63
 # Output file base name for HTML help builder.
73
-htmlhelp_basename = '%sdoc' % project
64
+htmlhelp_basename = 'python-ironic-inspector-clientdoc'
74 65
 
66
+latex_use_xindy = False
75 67
 
76 68
 # Grouping the document tree into LaTeX files. List of tuples
77 69
 # (source start file, target name, title, author, documentclass
@@ -79,8 +71,8 @@ htmlhelp_basename = '%sdoc' % project
79 71
 latex_documents = [
80 72
     (
81 73
         'index',
82
-        '%s.tex' % project,
83
-        u'%s Documentation' % project,
74
+        'doc-python-ironic-inspector-client.tex',
75
+        u'Python Ironic Inspector Client Documentation',
84 76
         u'OpenStack Foundation',
85 77
         'manual'
86 78
     ),

+ 1
- 0
lower-constraints.txt View File

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

+ 9
- 0
tox.ini View File

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

Loading…
Cancel
Save