blob: fbde86498af1435c513c65e68a6938bd75a5a088 [file] [log] [blame]
Zack Williams071eda22019-05-15 18:19:51 -07001# -*- coding: utf-8 -*-
2#
3# Configuration file for the Sphinx documentation builder.
4#
5# This file does only contain a selection of the most common options. For a
6# full list see the documentation:
7# http://www.sphinx-doc.org/en/master/config
8
9# -- Path setup --------------------------------------------------------------
10
11# If extensions (or modules to document with autodoc) are in another directory,
12# add these directories to sys.path here. If the directory is relative to the
13# documentation root, use os.path.abspath to make it absolute, like shown here.
Zack Williams071eda22019-05-15 18:19:51 -070014
Zack Williams16042b62020-03-29 22:03:16 -070015import os
16
17def get_version():
18 with open("VERSION") as f:
19 return f.read().strip()
20
Zack Williams071eda22019-05-15 18:19:51 -070021# -- Project information -----------------------------------------------------
22
23project = u'VOLTHA Docs'
Joey Armstrongbbd71d62022-10-12 11:51:35 -040024copyright = u'2019-2022, VOLTHA Contributors & Open Networking Foundation'
Zack Williams071eda22019-05-15 18:19:51 -070025author = u'VOLTHA Contributors'
26
27# The short X.Y version
Zack Williams16042b62020-03-29 22:03:16 -070028version = get_version()
Zack Williams071eda22019-05-15 18:19:51 -070029# The full version, including alpha/beta/rc tags
Zack Williams88df4742019-12-20 08:24:47 -070030release = version
Zack Williams071eda22019-05-15 18:19:51 -070031
32# -- General configuration ---------------------------------------------------
33
34# If your documentation needs a minimal Sphinx version, state it here.
35#
36# needs_sphinx = '1.0'
37
38# make all warnings errors
39warning_is_error = True
40
41# Add any Sphinx extension module names here, as strings. They can be
42# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
43# ones.
44extensions = [
45 'recommonmark',
46 'sphinx.ext.coverage',
Joey Armstrongbbd71d62022-10-12 11:51:35 -040047 'sphinx.ext.extlinks',
Zack Williams071eda22019-05-15 18:19:51 -070048 'sphinx.ext.graphviz',
49 'sphinx.ext.ifconfig',
50 'sphinx.ext.mathjax',
51 'sphinx.ext.todo',
Zack Williamsc6460c22019-12-18 14:54:43 -070052 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070053 "sphinx_multiversion",
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070054 "sphinx.ext.intersphinx",
Andrea Campanellac18d1182021-09-10 12:01:38 +020055 "sphinxcontrib.openapi",
Zack Williams071eda22019-05-15 18:19:51 -070056]
57
58# API documentation
59# https://github.com/rtfd/sphinx-autoapi
60# https://sphinx-autoapi.readthedocs.io
61# autoapi_type = 'go'
62# autoapi_dirs = [
63# 'voltha-go/cli/util',
64# 'voltha-go/rw_core/config',
65# 'voltha-go/rw_core/core',
66# 'voltha-go/rw_core/graph',
67# 'voltha-go/rw_core/utils',
68# ]
69
Zack Williamsc6460c22019-12-18 14:54:43 -070070# Text files with lists of words that shouldn't fail the spellchecker:
71spelling_word_list_filename=['dict.txt', ]
72
Joey Armstrongbbd71d62022-10-12 11:51:35 -040073#sphinx-multiversion prep, run in each versioned source directory
Zack Williams16042b62020-03-29 22:03:16 -070074prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070075 'ln -sf _root_/repos _target_/repos',
76 'make prep',
77]
78
Zack Williams6b2fcf22021-09-14 06:50:44 -070079# don't include tags
80smv_tag_whitelist = None
81
Zack Williams76744322020-04-09 22:00:35 -070082# inlcude only the branches matching master and voltha-*
83smv_branch_whitelist = r'^(master|voltha-.*)$'
84
85# include all remote branches
86smv_remote_whitelist = r'^.*$'
87
Zack Williams071eda22019-05-15 18:19:51 -070088# Add any paths that contain templates here, relative to this directory.
89templates_path = ['_templates']
90
91# The suffix(es) of source filenames.
92# You can specify multiple suffix as a list of string:
93#
94# source_suffix = ['.rst', '.md']
95source_suffix = ['.rst', '.md']
96
97# The master toctree document.
98master_doc = 'index'
99
100# The language for content autogenerated by Sphinx. Refer to documentation
101# for a list of supported languages.
102#
103# This is also used if you do content translation via gettext catalogs.
104# Usually you set "language" from the command line for these cases.
105language = None
106
107# List of patterns, relative to source directory, that match files and
108# directories to ignore when looking for source files.
109# This pattern also affects html_static_path and html_extra_path.
110exclude_patterns = [
111 '*/LICENSE.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700112 '*/RELEASE_NOTES.md',
Zack Williams071eda22019-05-15 18:19:51 -0700113 '*/vendor',
114 '.DS_Store',
115 'Thumbs.db',
116 '_build',
Zack Williams16042b62020-03-29 22:03:16 -0700117 'voltha-go/BUILD.md',
Andy Bavier39d67b12020-02-27 16:08:52 -0700118 'cord-tester/venv_cord',
119 'cord-tester/docs',
120 'cord-tester/src',
121 'cord-tester/README.md',
122 'cord-tester/cord-robot/README.rst',
Zack Williams16042b62020-03-29 22:03:16 -0700123 'openolt/agent/*',
Zack Williams071eda22019-05-15 18:19:51 -0700124 'repos',
125 'requirements.txt',
126 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700127 'CODE_OF_CONDUCT.md',
128 '*/CODE_OF_CONDUCT.md',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500129# Ignore all:
130 '**/__pycache__', # generated - faster traversal
131# Revisit: one directory pattern is sufficient.
132 '**/doc_venv',
133 '**/venv_docs',
134 '**/virtualenv',
135 '**/vst_venv',
Zack Williams071eda22019-05-15 18:19:51 -0700136]
137
138# The name of the Pygments (syntax highlighting) style to use.
139pygments_style = None
140
141# -- Options for HTML output -------------------------------------------------
142
143# The theme to use for HTML and HTML Help pages. See the documentation for
144# a list of builtin themes.
145#
146html_theme = 'sphinx_rtd_theme'
147
Zack Williams16042b62020-03-29 22:03:16 -0700148html_logo = '_static/voltha.svg'
149
150html_favicon = '_static/voltha-favicon-128.png'
151
Zack Williams071eda22019-05-15 18:19:51 -0700152# Theme options are theme-specific and customize the look and feel of a theme
153# further. For a list of options available for each theme, see the
154# documentation.
155#
Zack Williams16042b62020-03-29 22:03:16 -0700156html_theme_options = {
157 'logo_only': True
158}
Zack Williams071eda22019-05-15 18:19:51 -0700159
160# Add any paths that contain custom static files (such as style sheets) here,
161# relative to this directory. They are copied after the builtin static files,
162# so a file named "default.css" will overwrite the builtin "default.css".
163html_static_path = ['_static']
164
165# Custom sidebar templates, must be a dictionary that maps document names
166# to template names.
167#
168# The default sidebars (for documents that don't match any pattern) are
169# defined by theme itself. Builtin themes are using these templates by
170# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
171# 'searchbox.html']``.
172#
173# html_sidebars = {}
174
175
Zack Williams16042b62020-03-29 22:03:16 -0700176
Zack Williams071eda22019-05-15 18:19:51 -0700177# -- Options for HTMLHelp output ---------------------------------------------
178
179# Output file base name for HTML help builder.
180htmlhelp_basename = 'VOLTHADocs'
181
182
183# -- Options for LaTeX output ------------------------------------------------
184
185latex_elements = {
186 # The paper size ('letterpaper' or 'a4paper').
187 #
188 # 'papersize': 'letterpaper',
189
190 # The font size ('10pt', '11pt' or '12pt').
191 #
192 # 'pointsize': '10pt',
193
194 # Additional stuff for the LaTeX preamble.
195 #
196 # 'preamble': '',
197
198 # Latex figure (float) alignment
199 #
200 # 'figure_align': 'htbp',
201}
202
203# Grouping the document tree into LaTeX files. List of tuples
204# (source start file, target name, title,
205# author, documentclass [howto, manual, or own class]).
206latex_documents = [
207 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
208 u'VOLTHA Team', 'manual'),
209]
210
211
212# -- Options for manual page output ------------------------------------------
213
214# One entry per manual page. List of tuples
215# (source start file, name, description, authors, manual section).
216man_pages = [
217 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
218 [author], 1)
219]
220
221
222# -- Options for Texinfo output ----------------------------------------------
223
224# Grouping the document tree into Texinfo files. List of tuples
225# (source start file, target name, title, author,
226# dir menu entry, description, category)
227texinfo_documents = [
228 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
229 author, 'VOLTHADocs', 'One line description of project.',
230 'Miscellaneous'),
231]
232
233
234# -- Options for Epub output -------------------------------------------------
235
236# Bibliographic Dublin Core info.
237epub_title = project
238
239# The unique identifier of the text. This can be a ISBN number
240# or the project homepage.
241#
242# epub_identifier = ''
243
244# A unique identification for the text.
245#
246# epub_uid = ''
247
248# A list of files that should not be packed into the epub file.
249epub_exclude_files = ['search.html']
250
251
252# -- Extension configuration -------------------------------------------------
253
254# blockdiag/etc. config
255
256rackdiag_antialias = True
257rackdiag_html_image_format = "SVG"
258rackdiag_fontpath = [
259 "_static/fonts/Inconsolata-Regular.ttf",
260 "_static/fonts/Inconsolata-Bold.ttf",
261]
262
263nwdiag_antialias = True
264nwdiag_html_image_format = "SVG"
265nwdiag_fontpath = [
266 "_static/fonts/Inconsolata-Regular.ttf",
267 "_static/fonts/Inconsolata-Bold.ttf",
268]
269
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400270# -- Options for extlinks extension ------------------------------------------
271# ..seealso: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
272# 'vhc' : 'https://gerrit.opencord.org/plugins/gitiles/voltha-helm-charts',
273extlinks=\
274 {
275 'vol-jira' : ('https://jira.opencord.org/projects/VOL/issues/%s', 'jira::%s'),
276 'vol-ger' : ('https://gerrit.opencord.org/plugins/gitiles/%s', 'gerrit::%s'),
277 'vol-git' : ('https://github.com/opencord/%s', 'git::%s'),
278 }
279
Zack Williams071eda22019-05-15 18:19:51 -0700280# -- Options for todo extension ----------------------------------------------
281# If true, `todo` and `todoList` produce output, else they produce nothing.
282todo_include_todos = True
283
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100284# -- Options for linkcheck ---------------------------------------------------
285# The link checker strips off .md from links and then complains
Joey Armstrong36592e32022-11-28 09:00:28 -0500286linkcheck_ignore=\
287 [
288 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
289 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
290 r'https://www.sphinx-doc.org',
291 r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README',
292 r'https://github.com/opencord/voltha-helm-charts/blob/master/README',
293 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.9',
294 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.8',
Joey Armstrongf88b7382022-12-02 15:04:21 -0500295 #
296 r'../release_notes/voltha_2.2.html',
297 r'../release_notes/voltha_2.3.html',
298 r'../release_notes/voltha_2.4.html',
299 r'../release_notes/voltha_2.5.html',
300 r'../release_notes/voltha_2.6.html',
301 r'../release_notes/voltha_2.7.html',
302 r'../release_notes/voltha_2.8.html',
303 r'../release_notes/voltha_2.9.html',
304 r'../release_notes/voltha_2.10.html',
Joey Armstrong36592e32022-11-28 09:00:28 -0500305 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100306
Zack Williams071eda22019-05-15 18:19:51 -0700307# -- Configure recommonmark to use AutoStructify -----------------------------
308# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
309
310import recommonmark
311from recommonmark.transform import AutoStructify
312
313github_doc_root = 'https://github.com/opencord/voltha-docs'
314
315def setup(app):
316
317 app.add_css_file('css/rtd_theme_mods.css')
318
319 app.add_config_value('recommonmark_config', {
320 'url_resolver': lambda url: github_doc_root + url,
321 'auto_toc_tree_section': 'Contents',
322 }, True)
323
324 app.add_transform(AutoStructify)