blob: 05a442a128e52f76dc2454fa31da212c83cae82f [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 Williams76a16312021-09-14 06:50:44 -070028copyright = u'2019-2021, 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',
Zack Williamsc6460c22019-12-18 14:54:43 -070056 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070057 "sphinx_multiversion",
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070058 "sphinx.ext.intersphinx",
Zack Williams071eda22019-05-15 18:19:51 -070059]
60
61# API documentation
62# https://github.com/rtfd/sphinx-autoapi
63# https://sphinx-autoapi.readthedocs.io
64# autoapi_type = 'go'
65# autoapi_dirs = [
66# 'voltha-go/cli/util',
67# 'voltha-go/rw_core/config',
68# 'voltha-go/rw_core/core',
69# 'voltha-go/rw_core/graph',
70# 'voltha-go/rw_core/utils',
71# ]
72
Zack Williamsc6460c22019-12-18 14:54:43 -070073# Text files with lists of words that shouldn't fail the spellchecker:
74spelling_word_list_filename=['dict.txt', ]
75
Zack Williams16042b62020-03-29 22:03:16 -070076# sphinx-multiversion prep, run in each versioned source directory
77prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070078 'ln -sf _root_/repos _target_/repos',
79 'make prep',
80]
81
Zack Williams76a16312021-09-14 06:50:44 -070082# don't include tags
83smv_tag_whitelist = None
84
Zack Williams76744322020-04-09 22:00:35 -070085# inlcude only the branches matching master and voltha-*
86smv_branch_whitelist = r'^(master|voltha-.*)$'
87
88# include all remote branches
89smv_remote_whitelist = r'^.*$'
90
Zack Williams071eda22019-05-15 18:19:51 -070091# Add any paths that contain templates here, relative to this directory.
92templates_path = ['_templates']
93
94# The suffix(es) of source filenames.
95# You can specify multiple suffix as a list of string:
96#
97# source_suffix = ['.rst', '.md']
98source_suffix = ['.rst', '.md']
99
100# The master toctree document.
101master_doc = 'index'
102
103# The language for content autogenerated by Sphinx. Refer to documentation
104# for a list of supported languages.
105#
106# This is also used if you do content translation via gettext catalogs.
107# Usually you set "language" from the command line for these cases.
108language = None
109
110# List of patterns, relative to source directory, that match files and
111# directories to ignore when looking for source files.
112# This pattern also affects html_static_path and html_extra_path.
113exclude_patterns = [
114 '*/LICENSE.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700115 '*/RELEASE_NOTES.md',
Zack Williams071eda22019-05-15 18:19:51 -0700116 '*/vendor',
117 '.DS_Store',
118 'Thumbs.db',
119 '_build',
Zack Williams16042b62020-03-29 22:03:16 -0700120 'venv_docs',
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100121 'voltha-system-tests/vst_venv',
Zack Williams16042b62020-03-29 22:03:16 -0700122 'voltha-go/BUILD.md',
Andy Bavier39d67b12020-02-27 16:08:52 -0700123 'cord-tester/venv_cord',
124 'cord-tester/docs',
125 'cord-tester/src',
126 'cord-tester/README.md',
127 'cord-tester/cord-robot/README.rst',
Zack Williams16042b62020-03-29 22:03:16 -0700128 'openolt/agent/*',
Zack Williams071eda22019-05-15 18:19:51 -0700129 'repos',
130 'requirements.txt',
131 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700132 'CODE_OF_CONDUCT.md',
133 '*/CODE_OF_CONDUCT.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700134 'doc_venv/*'
Zack Williams071eda22019-05-15 18:19:51 -0700135]
136
137# The name of the Pygments (syntax highlighting) style to use.
138pygments_style = None
139
140# -- Options for HTML output -------------------------------------------------
141
142# The theme to use for HTML and HTML Help pages. See the documentation for
143# a list of builtin themes.
144#
145html_theme = 'sphinx_rtd_theme'
146
Zack Williams16042b62020-03-29 22:03:16 -0700147html_logo = '_static/voltha.svg'
148
149html_favicon = '_static/voltha-favicon-128.png'
150
Zack Williams071eda22019-05-15 18:19:51 -0700151# Theme options are theme-specific and customize the look and feel of a theme
152# further. For a list of options available for each theme, see the
153# documentation.
154#
Zack Williams16042b62020-03-29 22:03:16 -0700155html_theme_options = {
156 'logo_only': True
157}
Zack Williams071eda22019-05-15 18:19:51 -0700158
159# Add any paths that contain custom static files (such as style sheets) here,
160# relative to this directory. They are copied after the builtin static files,
161# so a file named "default.css" will overwrite the builtin "default.css".
162html_static_path = ['_static']
163
164# Custom sidebar templates, must be a dictionary that maps document names
165# to template names.
166#
167# The default sidebars (for documents that don't match any pattern) are
168# defined by theme itself. Builtin themes are using these templates by
169# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
170# 'searchbox.html']``.
171#
172# html_sidebars = {}
173
174
Zack Williams16042b62020-03-29 22:03:16 -0700175
Zack Williams071eda22019-05-15 18:19:51 -0700176# -- Options for HTMLHelp output ---------------------------------------------
177
178# Output file base name for HTML help builder.
179htmlhelp_basename = 'VOLTHADocs'
180
181
182# -- Options for LaTeX output ------------------------------------------------
183
184latex_elements = {
185 # The paper size ('letterpaper' or 'a4paper').
186 #
187 # 'papersize': 'letterpaper',
188
189 # The font size ('10pt', '11pt' or '12pt').
190 #
191 # 'pointsize': '10pt',
192
193 # Additional stuff for the LaTeX preamble.
194 #
195 # 'preamble': '',
196
197 # Latex figure (float) alignment
198 #
199 # 'figure_align': 'htbp',
200}
201
202# Grouping the document tree into LaTeX files. List of tuples
203# (source start file, target name, title,
204# author, documentclass [howto, manual, or own class]).
205latex_documents = [
206 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
207 u'VOLTHA Team', 'manual'),
208]
209
210
211# -- Options for manual page output ------------------------------------------
212
213# One entry per manual page. List of tuples
214# (source start file, name, description, authors, manual section).
215man_pages = [
216 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
217 [author], 1)
218]
219
220
221# -- Options for Texinfo output ----------------------------------------------
222
223# Grouping the document tree into Texinfo files. List of tuples
224# (source start file, target name, title, author,
225# dir menu entry, description, category)
226texinfo_documents = [
227 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
228 author, 'VOLTHADocs', 'One line description of project.',
229 'Miscellaneous'),
230]
231
232
233# -- Options for Epub output -------------------------------------------------
234
235# Bibliographic Dublin Core info.
236epub_title = project
237
238# The unique identifier of the text. This can be a ISBN number
239# or the project homepage.
240#
241# epub_identifier = ''
242
243# A unique identification for the text.
244#
245# epub_uid = ''
246
247# A list of files that should not be packed into the epub file.
248epub_exclude_files = ['search.html']
249
250
251# -- Extension configuration -------------------------------------------------
252
253# blockdiag/etc. config
254
255rackdiag_antialias = True
256rackdiag_html_image_format = "SVG"
257rackdiag_fontpath = [
258 "_static/fonts/Inconsolata-Regular.ttf",
259 "_static/fonts/Inconsolata-Bold.ttf",
260]
261
262nwdiag_antialias = True
263nwdiag_html_image_format = "SVG"
264nwdiag_fontpath = [
265 "_static/fonts/Inconsolata-Regular.ttf",
266 "_static/fonts/Inconsolata-Bold.ttf",
267]
268
269# -- Options for todo extension ----------------------------------------------
270# If true, `todo` and `todoList` produce output, else they produce nothing.
271todo_include_todos = True
272
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100273# -- Options for linkcheck ---------------------------------------------------
274# The link checker strips off .md from links and then complains
275linkcheck_ignore = [r'https://github.com/ciena/kind-voltha/blob/master/README',
276 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
Zack Williams16042b62020-03-29 22:03:16 -0700277 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
278 r'https://www.sphinx-doc.org',
Andrea Campanella9f534c72021-03-19 18:44:27 +0100279 r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README',
280 r'https://github.com/opencord/kind-voltha/blob/master/README'
Zack Williams16042b62020-03-29 22:03:16 -0700281 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100282
Zack Williams071eda22019-05-15 18:19:51 -0700283# -- Configure recommonmark to use AutoStructify -----------------------------
284# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
285
286import recommonmark
287from recommonmark.transform import AutoStructify
288
289github_doc_root = 'https://github.com/opencord/voltha-docs'
290
291def setup(app):
292
293 app.add_css_file('css/rtd_theme_mods.css')
294
295 app.add_config_value('recommonmark_config', {
296 'url_resolver': lambda url: github_doc_root + url,
297 'auto_toc_tree_section': 'Contents',
298 }, True)
299
300 app.add_transform(AutoStructify)