blob: b40278b752f3402323de18e822a6ece0ae561f10 [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.
14#
15# import os
16# import sys
17# sys.path.insert(0, os.path.abspath('.'))
18
Zack Williams16042b62020-03-29 22:03:16 -070019import os
20
21def get_version():
22 with open("VERSION") as f:
23 return f.read().strip()
24
Zack Williams071eda22019-05-15 18:19:51 -070025# -- Project information -----------------------------------------------------
26
27project = u'VOLTHA Docs'
Zack Williams16042b62020-03-29 22:03:16 -070028copyright = u'2019-2020, VOLTHA Contributors & Open Networking Foundation'
Zack Williams071eda22019-05-15 18:19:51 -070029author = u'VOLTHA Contributors'
30
31# The short X.Y version
Zack Williams16042b62020-03-29 22:03:16 -070032version = get_version()
Zack Williams071eda22019-05-15 18:19:51 -070033
34# The full version, including alpha/beta/rc tags
Zack Williams88df4742019-12-20 08:24:47 -070035release = version
Zack Williams071eda22019-05-15 18:19:51 -070036
37# -- General configuration ---------------------------------------------------
38
39# If your documentation needs a minimal Sphinx version, state it here.
40#
41# needs_sphinx = '1.0'
42
43# make all warnings errors
44warning_is_error = True
45
46# Add any Sphinx extension module names here, as strings. They can be
47# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
48# ones.
49extensions = [
50 'recommonmark',
51 'sphinx.ext.coverage',
52 'sphinx.ext.graphviz',
53 'sphinx.ext.ifconfig',
54 'sphinx.ext.mathjax',
55 'sphinx.ext.todo',
56 'sphinxcontrib.actdiag',
57 'sphinxcontrib.blockdiag',
58 'sphinxcontrib.nwdiag',
59 'sphinxcontrib.openapi',
60 'sphinxcontrib.packetdiag',
61 'sphinxcontrib.rackdiag',
62 'sphinxcontrib.seqdiag',
Zack Williamsc6460c22019-12-18 14:54:43 -070063 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070064 "sphinx_multiversion",
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070065 "sphinx.ext.intersphinx",
Zack Williams071eda22019-05-15 18:19:51 -070066# 'sphinxcontrib.golangdomain',
67# 'autoapi.extension',
68]
69
70# API documentation
71# https://github.com/rtfd/sphinx-autoapi
72# https://sphinx-autoapi.readthedocs.io
73# autoapi_type = 'go'
74# autoapi_dirs = [
75# 'voltha-go/cli/util',
76# 'voltha-go/rw_core/config',
77# 'voltha-go/rw_core/core',
78# 'voltha-go/rw_core/graph',
79# 'voltha-go/rw_core/utils',
80# ]
81
Zack Williamsc6460c22019-12-18 14:54:43 -070082# Text files with lists of words that shouldn't fail the spellchecker:
83spelling_word_list_filename=['dict.txt', ]
84
Zack Williams16042b62020-03-29 22:03:16 -070085# sphinx-multiversion prep, run in each versioned source directory
86prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070087 'ln -sf _root_/repos _target_/repos',
88 'make prep',
89]
90
Zack Williams76744322020-04-09 22:00:35 -070091# inlcude only the branches matching master and voltha-*
92smv_branch_whitelist = r'^(master|voltha-.*)$'
93
94# include all remote branches
95smv_remote_whitelist = r'^.*$'
96
Zack Williams071eda22019-05-15 18:19:51 -070097# Add any paths that contain templates here, relative to this directory.
98templates_path = ['_templates']
99
100# The suffix(es) of source filenames.
101# You can specify multiple suffix as a list of string:
102#
103# source_suffix = ['.rst', '.md']
104source_suffix = ['.rst', '.md']
105
106# The master toctree document.
107master_doc = 'index'
108
109# The language for content autogenerated by Sphinx. Refer to documentation
110# for a list of supported languages.
111#
112# This is also used if you do content translation via gettext catalogs.
113# Usually you set "language" from the command line for these cases.
114language = None
115
116# List of patterns, relative to source directory, that match files and
117# directories to ignore when looking for source files.
118# This pattern also affects html_static_path and html_extra_path.
119exclude_patterns = [
120 '*/LICENSE.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700121 '*/RELEASE_NOTES.md',
Zack Williams071eda22019-05-15 18:19:51 -0700122 '*/vendor',
123 '.DS_Store',
124 'Thumbs.db',
125 '_build',
Zack Williams16042b62020-03-29 22:03:16 -0700126 'venv_docs',
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100127 'voltha-system-tests/vst_venv',
Zack Williams16042b62020-03-29 22:03:16 -0700128 'voltha-go/BUILD.md',
Andy Bavier39d67b12020-02-27 16:08:52 -0700129 'cord-tester/venv_cord',
130 'cord-tester/docs',
131 'cord-tester/src',
132 'cord-tester/README.md',
133 'cord-tester/cord-robot/README.rst',
Zack Williams16042b62020-03-29 22:03:16 -0700134 'openolt/agent/*',
Zack Williams071eda22019-05-15 18:19:51 -0700135 'repos',
136 'requirements.txt',
137 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700138 'CODE_OF_CONDUCT.md',
139 '*/CODE_OF_CONDUCT.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700140 'doc_venv/*'
Zack Williams071eda22019-05-15 18:19:51 -0700141]
142
143# The name of the Pygments (syntax highlighting) style to use.
144pygments_style = None
145
146# -- Options for HTML output -------------------------------------------------
147
148# The theme to use for HTML and HTML Help pages. See the documentation for
149# a list of builtin themes.
150#
151html_theme = 'sphinx_rtd_theme'
152
Zack Williams16042b62020-03-29 22:03:16 -0700153html_logo = '_static/voltha.svg'
154
155html_favicon = '_static/voltha-favicon-128.png'
156
Zack Williams071eda22019-05-15 18:19:51 -0700157# Theme options are theme-specific and customize the look and feel of a theme
158# further. For a list of options available for each theme, see the
159# documentation.
160#
Zack Williams16042b62020-03-29 22:03:16 -0700161html_theme_options = {
162 'logo_only': True
163}
Zack Williams071eda22019-05-15 18:19:51 -0700164
165# Add any paths that contain custom static files (such as style sheets) here,
166# relative to this directory. They are copied after the builtin static files,
167# so a file named "default.css" will overwrite the builtin "default.css".
168html_static_path = ['_static']
169
170# Custom sidebar templates, must be a dictionary that maps document names
171# to template names.
172#
173# The default sidebars (for documents that don't match any pattern) are
174# defined by theme itself. Builtin themes are using these templates by
175# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
176# 'searchbox.html']``.
177#
178# html_sidebars = {}
179
180
Zack Williams16042b62020-03-29 22:03:16 -0700181
Zack Williams071eda22019-05-15 18:19:51 -0700182# -- Options for HTMLHelp output ---------------------------------------------
183
184# Output file base name for HTML help builder.
185htmlhelp_basename = 'VOLTHADocs'
186
187
188# -- Options for LaTeX output ------------------------------------------------
189
190latex_elements = {
191 # The paper size ('letterpaper' or 'a4paper').
192 #
193 # 'papersize': 'letterpaper',
194
195 # The font size ('10pt', '11pt' or '12pt').
196 #
197 # 'pointsize': '10pt',
198
199 # Additional stuff for the LaTeX preamble.
200 #
201 # 'preamble': '',
202
203 # Latex figure (float) alignment
204 #
205 # 'figure_align': 'htbp',
206}
207
208# Grouping the document tree into LaTeX files. List of tuples
209# (source start file, target name, title,
210# author, documentclass [howto, manual, or own class]).
211latex_documents = [
212 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
213 u'VOLTHA Team', 'manual'),
214]
215
216
217# -- Options for manual page output ------------------------------------------
218
219# One entry per manual page. List of tuples
220# (source start file, name, description, authors, manual section).
221man_pages = [
222 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
223 [author], 1)
224]
225
226
227# -- Options for Texinfo output ----------------------------------------------
228
229# Grouping the document tree into Texinfo files. List of tuples
230# (source start file, target name, title, author,
231# dir menu entry, description, category)
232texinfo_documents = [
233 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
234 author, 'VOLTHADocs', 'One line description of project.',
235 'Miscellaneous'),
236]
237
238
239# -- Options for Epub output -------------------------------------------------
240
241# Bibliographic Dublin Core info.
242epub_title = project
243
244# The unique identifier of the text. This can be a ISBN number
245# or the project homepage.
246#
247# epub_identifier = ''
248
249# A unique identification for the text.
250#
251# epub_uid = ''
252
253# A list of files that should not be packed into the epub file.
254epub_exclude_files = ['search.html']
255
256
257# -- Extension configuration -------------------------------------------------
258
259# blockdiag/etc. config
260
261rackdiag_antialias = True
262rackdiag_html_image_format = "SVG"
263rackdiag_fontpath = [
264 "_static/fonts/Inconsolata-Regular.ttf",
265 "_static/fonts/Inconsolata-Bold.ttf",
266]
267
268nwdiag_antialias = True
269nwdiag_html_image_format = "SVG"
270nwdiag_fontpath = [
271 "_static/fonts/Inconsolata-Regular.ttf",
272 "_static/fonts/Inconsolata-Bold.ttf",
273]
274
275# -- Options for todo extension ----------------------------------------------
276# If true, `todo` and `todoList` produce output, else they produce nothing.
277todo_include_todos = True
278
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100279# -- Options for linkcheck ---------------------------------------------------
280# The link checker strips off .md from links and then complains
281linkcheck_ignore = [r'https://github.com/ciena/kind-voltha/blob/master/README',
282 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
Zack Williams16042b62020-03-29 22:03:16 -0700283 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
284 r'https://www.sphinx-doc.org',
Andrea Campanella9f534c72021-03-19 18:44:27 +0100285 r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README',
286 r'https://github.com/opencord/kind-voltha/blob/master/README'
Zack Williams16042b62020-03-29 22:03:16 -0700287 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100288
Zack Williams071eda22019-05-15 18:19:51 -0700289# -- Configure recommonmark to use AutoStructify -----------------------------
290# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
291
292import recommonmark
293from recommonmark.transform import AutoStructify
294
295github_doc_root = 'https://github.com/opencord/voltha-docs'
296
297def setup(app):
298
299 app.add_css_file('css/rtd_theme_mods.css')
300
301 app.add_config_value('recommonmark_config', {
302 'url_resolver': lambda url: github_doc_root + url,
303 'auto_toc_tree_section': 'Contents',
304 }, True)
305
306 app.add_transform(AutoStructify)