b007a9e9917d5920d5899562dff70ed7573aa68b
[releng/global-jjb.git] / docs / conf.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 #
4 # Linux Foundation Release Engineering Tools documentation build configuration file, created by
5 # sphinx-quickstart on Sat Mar  4 12:20:05 2017.
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 # If extensions (or modules to document with autodoc) are in another directory,
17 # add these directories to sys.path here. If the directory is relative to the
18 # documentation root, use os.path.abspath to make it absolute, like shown here.
19 #
20 import os
21 import subprocess
22 import sys
23 import sphinx_bootstrap_theme
24
25 sys.path.insert(0, os.path.abspath('..'))
26
27
28 def format_version(version):
29     fmt = '{tag}.dev{commitcount}+{gitsha}'
30     parts = version.split('-')
31     assert len(parts) in (3, 4)
32     dirty = len(parts) == 4
33     tag, count, sha = parts[:3]
34     if count == '0' and not dirty:
35         return tag
36     return fmt.format(tag=tag, commitcount=count, gitsha=sha.lstrip('g'))
37
38
39 # -- General configuration ------------------------------------------------
40
41 # If your documentation needs a minimal Sphinx version, state it here.
42 #
43 # needs_sphinx = '1.0'
44
45 # Add any Sphinx extension module names here, as strings. They can be
46 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47 # ones.
48 extensions = [
49     'sphinx.ext.autodoc',
50     'sphinx.ext.doctest',
51     'sphinx.ext.intersphinx',
52     'sphinx.ext.todo',
53     'sphinx.ext.coverage',
54     'sphinx.ext.viewcode',
55     'sphinxcontrib.programoutput',
56 ]
57
58 # Add any paths that contain templates here, relative to this directory.
59 templates_path = ['_templates']
60
61 # The suffix(es) of source filenames.
62 # You can specify multiple suffix as a list of string:
63 #
64 # source_suffix = ['.rst', '.md']
65 source_suffix = '.rst'
66
67 # The encoding of source files.
68 #
69 # source_encoding = 'utf-8-sig'
70
71 # The master toctree document.
72 master_doc = 'index'
73
74 # General information about the project.
75 project = 'lf-releng-global-jjb'
76 copyright = '2017, The Linux Foundation'
77 author = 'Linux Foundation Releng'
78
79 # The version info for the project you're documenting, acts as replacement for
80 # |version| and |release|, also used in various other places throughout the
81 # built documents.
82 #
83 # The short X.Y version.
84 command = 'git describe --tags --long --dirty'
85 try:
86     git_version = format_version(
87         subprocess.check_output(command.split()).decode('utf-8').strip())
88 except subprocess.CalledProcessError:  # Handle docs builds from tarball
89     git_version = "v0.0.9999-local"
90 version = git_version
91 # The full version, including alpha/beta/rc tags.
92 release = version
93
94 # The language for content autogenerated by Sphinx. Refer to documentation
95 # for a list of supported languages.
96 #
97 # This is also used if you do content translation via gettext catalogs.
98 # Usually you set "language" from the command line for these cases.
99 language = None
100
101 # There are two options for replacing |today|: either, you set today to some
102 # non-false value, then it is used:
103 #
104 # today = ''
105 #
106 # Else, today_fmt is used as the format for a strftime call.
107 #
108 # today_fmt = '%B %d, %Y'
109
110 # List of patterns, relative to source directory, that match files and
111 # directories to ignore when looking for source files.
112 # This patterns also effect to html_static_path and html_extra_path
113 exclude_patterns = []
114
115 # The reST default role (used for this markup: `text`) to use for all
116 # documents.
117 #
118 # default_role = None
119
120 # If true, '()' will be appended to :func: etc. cross-reference text.
121 #
122 # add_function_parentheses = True
123
124 # If true, the current module name will be prepended to all description
125 # unit titles (such as .. function::).
126 #
127 # add_module_names = True
128
129 # If true, sectionauthor and moduleauthor directives will be shown in the
130 # output. They are ignored by default.
131 #
132 # show_authors = False
133
134 # The name of the Pygments (syntax highlighting) style to use.
135 pygments_style = 'sphinx'
136
137 # A list of ignored prefixes for module index sorting.
138 # modindex_common_prefix = []
139
140 # If true, keep warnings as "system message" paragraphs in the built documents.
141 # keep_warnings = False
142
143 # If true, `todo` and `todoList` produce output, else they produce nothing.
144 todo_include_todos = True
145
146
147 # -- Options for HTML output ----------------------------------------------
148
149 # The theme to use for HTML and HTML Help pages.  See the documentation for
150 # a list of builtin themes.
151 #
152 html_theme = 'bootstrap'
153
154 # Theme options are theme-specific and customize the look and feel of a theme
155 # further.  For a list of options available for each theme, see the
156 # documentation.
157 #
158 # html_theme_options = {}
159 html_theme_options = {
160     'bootswatch_theme': "cerulean",
161     'navbar_sidebarrel': False,
162     'source_link_position': "footer",
163 }
164
165 # Add any paths that contain custom themes here, relative to this directory.
166 # html_theme_path = []
167 html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
168
169 # The name for this set of Sphinx documents.
170 # "<project> v<release> documentation" by default.
171 #
172 # html_title = 'Linux Foundation Release Engineering Tools v0.0.1'
173
174 # A shorter title for the navigation bar.  Default is the same as html_title.
175 #
176 # html_short_title = None
177
178 # The name of an image file (relative to this directory) to place at the top
179 # of the sidebar.
180 #
181 html_logo = '_static/lf-logo-small.png'
182
183 # The name of an image file (relative to this directory) to use as a favicon of
184 # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
185 # pixels large.
186 #
187 html_favicon = 'favicon.ico'
188
189 # Add any paths that contain custom static files (such as style sheets) here,
190 # relative to this directory. They are copied after the builtin static files,
191 # so a file named "default.css" will overwrite the builtin "default.css".
192 html_static_path = ['_static']
193
194 # Add any extra paths that contain custom files (such as robots.txt or
195 # .htaccess) here, relative to this directory. These files are copied
196 # directly to the root of the documentation.
197 #
198 # html_extra_path = []
199
200 # If not None, a 'Last updated on:' timestamp is inserted at every page
201 # bottom, using the given strftime format.
202 # The empty string is equivalent to '%b %d, %Y'.
203 #
204 # html_last_updated_fmt = None
205
206 # If true, SmartyPants will be used to convert quotes and dashes to
207 # typographically correct entities.
208 #
209 # html_use_smartypants = True
210
211 # Custom sidebar templates, maps document names to template names.
212 #
213 html_sidebars = {
214     '**': ['localtoc.html', 'relations.html'],
215 }
216
217 # Additional templates that should be rendered to pages, maps page names to
218 # template names.
219 #
220 # html_additional_pages = {}
221
222 # If false, no module index is generated.
223 #
224 # html_domain_indices = True
225
226 # If false, no index is generated.
227 #
228 # html_use_index = True
229
230 # If true, the index is split into individual pages for each letter.
231 #
232 # html_split_index = False
233
234 # If true, links to the reST sources are added to the pages.
235 #
236 # html_show_sourcelink = True
237
238 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
239 #
240 # html_show_sphinx = True
241
242 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
243 #
244 # html_show_copyright = True
245
246 # If true, an OpenSearch description file will be output, and all pages will
247 # contain a <link> tag referring to it.  The value of this option must be the
248 # base URL from which the finished HTML is served.
249 #
250 # html_use_opensearch = ''
251
252 # This is the file name suffix for HTML files (e.g. ".xhtml").
253 # html_file_suffix = None
254
255 # Language to be used for generating the HTML full-text search index.
256 # Sphinx supports the following languages:
257 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
258 #   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
259 #
260 # html_search_language = 'en'
261
262 # A dictionary with options for the search language support, empty by default.
263 # 'ja' uses this config value.
264 # 'zh' user can custom change `jieba` dictionary path.
265 #
266 # html_search_options = {'type': 'default'}
267
268 # The name of a javascript file (relative to the configuration directory) that
269 # implements a search results scorer. If empty, the default will be used.
270 #
271 # html_search_scorer = 'scorer.js'
272
273 # Output file base name for HTML help builder.
274 htmlhelp_basename = 'LinuxFoundationReleaseEngineeringGJJBdoc'
275
276 # Example configuration for intersphinx: refer to the Python standard library.
277 intersphinx_mapping = {
278     'jjb': ('https://docs.openstack.org/infra/jenkins-job-builder/', None),
279     'lftools': ('http://lftools.releng.linuxfoundation.org/en/latest/', None),
280     'python': ('https://docs.python.org/', None),
281 }