Fix sphinx warnings (and some formatting)
[docs.git] / docs / conf.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 #
4 # OpenDaylight Documentation documentation build configuration file, created by
5 # sphinx-quickstart on Mon Mar 28 14:20:08 2016.
6 #
7 # This file is execfile()d with the current directory set to its
8 # containing dir.
9 #
10 # Note that not all possible configuration values are present in this
11 # autogenerated file.
12 #
13 # All configuration values have a default; values that are commented out
14 # serve to show the default.
15
16 import sys
17 import os
18 import sphinx_bootstrap_theme
19
20 # If extensions (or modules to document with autodoc) are in another directory,
21 # add these directories to sys.path here. If the directory is relative to the
22 # documentation root, use os.path.abspath to make it absolute, like shown here.
23 sys.path.insert(0, os.path.abspath('submodules/spectrometer/server'))
24
25 # -- General configuration ------------------------------------------------
26
27 # If your documentation needs a minimal Sphinx version, state it here.
28 #needs_sphinx = '1.0'
29
30 # Add any Sphinx extension module names here, as strings. They can be
31 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32 # ones.
33 extensions = ['sphinx.ext.autodoc']
34
35 # Disable javasphinx generation until we have a solution to long build
36 # times. readthedocs timesout after 902 seconds.
37 javasphinx_available = False
38 try:
39     import javasphinx
40     javasphinx_available = True
41     extensions.append('javasphinx')
42 except ImportError, e:
43     pass
44
45 # Add any paths that contain templates here, relative to this directory.
46 templates_path = ['_templates']
47
48 # The suffix(es) of source filenames.
49 # You can specify multiple suffix as a list of string:
50 # source_suffix = ['.rst', '.md']
51 source_suffix = '.rst'
52
53 # The encoding of source files.
54 #source_encoding = 'utf-8-sig'
55
56 # The master toctree document.
57 master_doc = 'index'
58
59 # General information about the project.
60 project = 'OpenDaylight Documentation'
61 copyright = '2016, OpenDaylight Project'
62 author = 'OpenDaylight Project'
63
64 # The version info for the project you're documenting, acts as replacement for
65 # |version| and |release|, also used in various other places throughout the
66 # built documents.
67 #
68 # The short X.Y version.
69 version = 'Carbon'
70 # The full version, including alpha/beta/rc tags.
71 release = 'Carbon'
72
73 # The language for content autogenerated by Sphinx. Refer to documentation
74 # for a list of supported languages.
75 #
76 # This is also used if you do content translation via gettext catalogs.
77 # Usually you set "language" from the command line for these cases.
78 language = None
79
80 # There are two options for replacing |today|: either, you set today to some
81 # non-false value, then it is used:
82 #today = ''
83 # Else, today_fmt is used as the format for a strftime call.
84 #today_fmt = '%B %d, %Y'
85
86 # List of patterns, relative to source directory, that match files and
87 # directories to ignore when looking for source files.
88 # This patterns also effect to html_static_path and html_extra_path
89 exclude_patterns = []
90
91 # The reST default role (used for this markup: `text`) to use for all
92 # documents.
93 #default_role = None
94
95 # If true, '()' will be appended to :func: etc. cross-reference text.
96 #add_function_parentheses = True
97
98 # If true, the current module name will be prepended to all description
99 # unit titles (such as .. function::).
100 #add_module_names = True
101
102 # If true, sectionauthor and moduleauthor directives will be shown in the
103 # output. They are ignored by default.
104 #show_authors = False
105
106 # The name of the Pygments (syntax highlighting) style to use.
107 pygments_style = 'sphinx'
108
109 # A list of ignored prefixes for module index sorting.
110 #modindex_common_prefix = []
111
112 # If true, keep warnings as "system message" paragraphs in the built documents.
113 #keep_warnings = False
114
115 # If true, `todo` and `todoList` produce output, else they produce nothing.
116 todo_include_todos = False
117
118
119 # -- Options for HTML output ----------------------------------------------
120
121 # The theme to use for HTML and HTML Help pages.  See the documentation for
122 # a list of builtin themes.
123 html_theme = 'bootstrap'
124
125 # Theme options are theme-specific and customize the look and feel of a theme
126 # further.  For a list of options available for each theme, see the
127 # documentation.
128 #html_theme_options = {}
129 html_theme_options = {
130     'bootswatch_theme': "united",
131 }
132
133 # Add any paths that contain custom themes here, relative to this directory.
134 #html_theme_path = []
135 html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
136
137 # The name for this set of Sphinx documents.
138 # "<project> v<release> documentation" by default.
139 #html_title = 'OpenDaylight Documentation v0.3.0'
140
141 # A shorter title for the navigation bar.  Default is the same as html_title.
142 #html_short_title = None
143
144 # The name of an image file (relative to this directory) to place at the top
145 # of the sidebar.
146 html_logo = '_static/odl_small.png'
147
148 # The name of an image file (relative to this directory) to use as a favicon of
149 # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
150 # pixels large.
151 html_favicon = 'favicon.ico'
152
153 # Add any paths that contain custom static files (such as style sheets) here,
154 # relative to this directory. They are copied after the builtin static files,
155 # so a file named "default.css" will overwrite the builtin "default.css".
156 html_static_path = ['_static']
157
158 # Add any extra paths that contain custom files (such as robots.txt or
159 # .htaccess) here, relative to this directory. These files are copied
160 # directly to the root of the documentation.
161 #html_extra_path = []
162
163 # If not None, a 'Last updated on:' timestamp is inserted at every page
164 # bottom, using the given strftime format.
165 # The empty string is equivalent to '%b %d, %Y'.
166 #html_last_updated_fmt = None
167
168 # If true, SmartyPants will be used to convert quotes and dashes to
169 # typographically correct entities.
170 #html_use_smartypants = True
171
172 # Custom sidebar templates, maps document names to template names.
173 #html_sidebars = {}
174
175 # Additional templates that should be rendered to pages, maps page names to
176 # template names.
177 #html_additional_pages = {}
178
179 # If false, no module index is generated.
180 #html_domain_indices = True
181
182 # If false, no index is generated.
183 #html_use_index = True
184
185 # If true, the index is split into individual pages for each letter.
186 #html_split_index = False
187
188 # If true, links to the reST sources are added to the pages.
189 #html_show_sourcelink = True
190
191 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
192 #html_show_sphinx = True
193
194 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
195 #html_show_copyright = True
196
197 # If true, an OpenSearch description file will be output, and all pages will
198 # contain a <link> tag referring to it.  The value of this option must be the
199 # base URL from which the finished HTML is served.
200 #html_use_opensearch = ''
201
202 # This is the file name suffix for HTML files (e.g. ".xhtml").
203 #html_file_suffix = None
204
205 # Language to be used for generating the HTML full-text search index.
206 # Sphinx supports the following languages:
207 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
208 #   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
209 #html_search_language = 'en'
210
211 # A dictionary with options for the search language support, empty by default.
212 # 'ja' uses this config value.
213 # 'zh' user can custom change `jieba` dictionary path.
214 #html_search_options = {'type': 'default'}
215
216 # The name of a javascript file (relative to the configuration directory) that
217 # implements a search results scorer. If empty, the default will be used.
218 #html_search_scorer = 'scorer.js'
219
220 # Output file base name for HTML help builder.
221 htmlhelp_basename = 'OpenDaylightDocumentationdoc'
222
223 # -- Options for LaTeX output ---------------------------------------------
224
225 latex_elements = {
226 # The paper size ('letterpaper' or 'a4paper').
227 #'papersize': 'letterpaper',
228
229 # The font size ('10pt', '11pt' or '12pt').
230 #'pointsize': '10pt',
231
232 # Additional stuff for the LaTeX preamble.
233 #'preamble': '',
234
235 # Latex figure (float) alignment
236 #'figure_align': 'htbp',
237 }
238
239 # Grouping the document tree into LaTeX files. List of tuples
240 # (source start file, target name, title,
241 #  author, documentclass [howto, manual, or own class]).
242 latex_documents = [
243     (master_doc, 'OpenDaylightDocumentation.tex', 'OpenDaylight Documentation Documentation',
244      'OpenDaylight Project', 'manual'),
245 ]
246
247 # The name of an image file (relative to this directory) to place at the top of
248 # the title page.
249 #latex_logo = None
250
251 # For "manual" documents, if this is true, then toplevel headings are parts,
252 # not chapters.
253 #latex_use_parts = False
254
255 # If true, show page references after internal links.
256 #latex_show_pagerefs = False
257
258 # If true, show URL addresses after external links.
259 #latex_show_urls = False
260
261 # Documents to append as an appendix to all manuals.
262 #latex_appendices = []
263
264 # If false, no module index is generated.
265 #latex_domain_indices = True
266
267
268 # -- Options for manual page output ---------------------------------------
269
270 # One entry per manual page. List of tuples
271 # (source start file, name, description, authors, manual section).
272 man_pages = [
273     (master_doc, 'opendaylightdocumentation', 'OpenDaylight Documentation Documentation',
274      [author], 1)
275 ]
276
277 # If true, show URL addresses after external links.
278 #man_show_urls = False
279
280
281 # -- Options for Texinfo output -------------------------------------------
282
283 # Grouping the document tree into Texinfo files. List of tuples
284 # (source start file, target name, title, author,
285 #  dir menu entry, description, category)
286 texinfo_documents = [
287     (master_doc, 'OpenDaylightDocumentation', 'OpenDaylight Documentation Documentation',
288      author, 'OpenDaylightDocumentation', 'One line description of project.',
289      'Miscellaneous'),
290 ]
291
292 # Documents to append as an appendix to all manuals.
293 #texinfo_appendices = []
294
295 # If false, no module index is generated.
296 #texinfo_domain_indices = True
297
298 # How to display URL addresses: 'footnote', 'no', or 'inline'.
299 #texinfo_show_urls = 'footnote'
300
301 # If true, do not generate a @detailmenu in the "Top" node's menu.
302 #texinfo_no_detailmenu = False
303
304
305 linkcheck_ignore = [
306     # Ignore jenkins because it's often slow to respond.
307     'https://jenkins.opendaylight.org/releng',
308     'https://jenkins.opendaylight.org/sandbox',
309     'http://\$CONTROL_HOST:8181/dlux/index.html',
310     # The '#' in the path makes sphinx think it's an anchor
311     'https://git.opendaylight.org/gerrit/#/admin/projects/releng/builder',
312 ]
313
314 import platform
315 if platform.system() != 'Windows':
316
317     # Build integration stuff
318     import subprocess
319
320     subprocess.call(["./build-integration-robot-libdoc.sh"])
321
322     # Disable javasphinx generation until we have a solution to long build
323     # times. readthedocs timesout after 902 seconds.
324     if javasphinx_available:
325         subprocess.call(["./generate-javaapidoc.sh"])
326