00ff1727c76443b32bb15f51074da070562b7039
[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 os
17 import sys
18 import time
19 import sphinx_bootstrap_theme
20
21 # If extensions (or modules to document with autodoc) are in another directory,
22 # add these directories to sys.path here. If the directory is relative to the
23 # documentation root, use os.path.abspath to make it absolute, like shown here.
24 sys.path.insert(0, os.path.abspath('submodules/spectrometer/server'))
25
26 # -- General configuration ------------------------------------------------
27
28 # If your documentation needs a minimal Sphinx version, state it here.
29 #needs_sphinx = '1.0'
30
31 # Add any Sphinx extension module names here, as strings. They can be
32 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33 # ones.
34 extensions = ['sphinx.ext.autodoc','sphinx.ext.graphviz']
35
36 # Disable javasphinx generation until we have a solution to long build
37 # times. readthedocs timesout after 902 seconds.
38 javasphinx_available = False
39 try:
40     import javasphinx
41     javasphinx_available = True
42     extensions.append('javasphinx')
43 except ImportError, e:
44     pass
45
46 # Add any paths that contain templates here, relative to this directory.
47 templates_path = ['_templates']
48
49 # The suffix(es) of source filenames.
50 # You can specify multiple suffix as a list of string:
51 # source_suffix = ['.rst', '.md']
52 source_suffix = '.rst'
53
54 # The encoding of source files.
55 #source_encoding = 'utf-8-sig'
56
57 # The master toctree document.
58 master_doc = 'index'
59
60 # General information about the project.
61 project = 'OpenDaylight Documentation'
62 copyright = '2016-{}, OpenDaylight Project'.format(time.strftime("%Y"))
63 author = 'OpenDaylight Project'
64
65 # The version info for the project you're documenting, acts as replacement for
66 # |version| and |release|, also used in various other places throughout the
67 # built documents.
68 version = 'Oxygen'  # The short X.Y version.
69 release = version   # The full version, including alpha/beta/rc tags.
70
71 # The language for content autogenerated by Sphinx. Refer to documentation
72 # for a list of supported languages.
73 #
74 # This is also used if you do content translation via gettext catalogs.
75 # Usually you set "language" from the command line for these cases.
76 language = None
77
78 # There are two options for replacing |today|: either, you set today to some
79 # non-false value, then it is used:
80 #today = ''
81 # Else, today_fmt is used as the format for a strftime call.
82 #today_fmt = '%B %d, %Y'
83
84 # List of patterns, relative to source directory, that match files and
85 # directories to ignore when looking for source files.
86 # This patterns also effect to html_static_path and html_extra_path
87 exclude_patterns = []
88
89 # The reST default role (used for this markup: `text`) to use for all
90 # documents.
91 #default_role = None
92
93 # If true, '()' will be appended to :func: etc. cross-reference text.
94 #add_function_parentheses = True
95
96 # If true, the current module name will be prepended to all description
97 # unit titles (such as .. function::).
98 #add_module_names = True
99
100 # If true, sectionauthor and moduleauthor directives will be shown in the
101 # output. They are ignored by default.
102 #show_authors = False
103
104 # The name of the Pygments (syntax highlighting) style to use.
105 pygments_style = 'sphinx'
106
107 # A list of ignored prefixes for module index sorting.
108 #modindex_common_prefix = []
109
110 # If true, keep warnings as "system message" paragraphs in the built documents.
111 #keep_warnings = False
112
113 # If true, `todo` and `todoList` produce output, else they produce nothing.
114 todo_include_todos = False
115
116
117 # -- Options for HTML output ----------------------------------------------
118
119 # The theme to use for HTML and HTML Help pages.  See the documentation for
120 # a list of builtin themes.
121 html_theme = 'bootstrap'
122
123 # Theme options are theme-specific and customize the look and feel of a theme
124 # further.  For a list of options available for each theme, see the
125 # documentation.
126 #html_theme_options = {}
127 html_theme_options = {
128     'bootswatch_theme': "united",
129     'navbar_sidebarrel': False,
130     'source_link_position': "footer",
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     '**': ['localtoc.html', 'relations.html'],
175 }
176
177 # Additional templates that should be rendered to pages, maps page names to
178 # template names.
179 #html_additional_pages = {}
180
181 # If false, no module index is generated.
182 #html_domain_indices = True
183
184 # If false, no index is generated.
185 #html_use_index = True
186
187 # If true, the index is split into individual pages for each letter.
188 #html_split_index = False
189
190 # If true, links to the reST sources are added to the pages.
191 #html_show_sourcelink = True
192
193 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
194 #html_show_sphinx = True
195
196 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
197 #html_show_copyright = True
198
199 # If true, an OpenSearch description file will be output, and all pages will
200 # contain a <link> tag referring to it.  The value of this option must be the
201 # base URL from which the finished HTML is served.
202 #html_use_opensearch = ''
203
204 # This is the file name suffix for HTML files (e.g. ".xhtml").
205 #html_file_suffix = None
206
207 # Language to be used for generating the HTML full-text search index.
208 # Sphinx supports the following languages:
209 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
210 #   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
211 #html_search_language = 'en'
212
213 # A dictionary with options for the search language support, empty by default.
214 # 'ja' uses this config value.
215 # 'zh' user can custom change `jieba` dictionary path.
216 #html_search_options = {'type': 'default'}
217
218 # The name of a javascript file (relative to the configuration directory) that
219 # implements a search results scorer. If empty, the default will be used.
220 #html_search_scorer = 'scorer.js'
221
222 # Output file base name for HTML help builder.
223 htmlhelp_basename = 'OpenDaylightDocumentation'
224
225 linkcheck_ignore = [
226     # Ignore jenkins because it's often slow to respond.
227     'https://jenkins.opendaylight.org/releng',
228     'https://jenkins.opendaylight.org/sandbox',
229     'http://\$CONTROL_HOST:8181/dlux/index.html',
230     # The '#' in the path makes sphinx think it's an anchor
231     'https://git.opendaylight.org/gerrit/#/admin/projects/releng/builder',
232 ]
233
234 nitpicky = True
235
236 import platform
237 if platform.system() != 'Windows':
238
239     # Build integration stuff
240     import subprocess
241
242     subprocess.call(["./build-integration-robot-libdoc.sh"])
243
244     # Disable javasphinx generation until we have a solution to long build
245     # times. readthedocs timesout after 902 seconds.
246     if javasphinx_available:
247         subprocess.call(["./generate-javaapidoc.sh"])