blob: 2bff8453b88b622f71a7f9e3069295b60b864bd3 [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
Joey Armstrong56334fc2023-01-15 22:53:19 -050015##-------------------##
16##---] IMPORTS [---##
17##-------------------##
Zack Williams16042b62020-03-29 22:03:16 -070018import os
Joey Armstrong56334fc2023-01-15 22:53:19 -050019import sys
20from pathlib import Path
Zack Williams16042b62020-03-29 22:03:16 -070021
Joey Armstrong56334fc2023-01-15 22:53:19 -050022if True:
23 pwd = Path(__file__).parent.as_posix()
24 sys.path.append(pwd)
25
26# -----------------------------------------------------------------------
27# -----------------------------------------------------------------------
Zack Williams16042b62020-03-29 22:03:16 -070028def get_version():
29 with open("VERSION") as f:
30 return f.read().strip()
31
Zack Williams071eda22019-05-15 18:19:51 -070032# -- Project information -----------------------------------------------------
33
34project = u'VOLTHA Docs'
Joey Armstrong56334fc2023-01-15 22:53:19 -050035copyright = u'Copyright 2019-2023 Open Networking Foundation (ONF) and the ONF Contributors'
Zack Williams071eda22019-05-15 18:19:51 -070036author = u'VOLTHA Contributors'
37
38# The short X.Y version
Zack Williams16042b62020-03-29 22:03:16 -070039version = get_version()
Zack Williams071eda22019-05-15 18:19:51 -070040# The full version, including alpha/beta/rc tags
Zack Williams88df4742019-12-20 08:24:47 -070041release = version
Zack Williams071eda22019-05-15 18:19:51 -070042
43# -- General configuration ---------------------------------------------------
44
45# If your documentation needs a minimal Sphinx version, state it here.
46#
47# needs_sphinx = '1.0'
48
49# make all warnings errors
50warning_is_error = True
51
52# Add any Sphinx extension module names here, as strings. They can be
53# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
54# ones.
55extensions = [
56 'recommonmark',
57 'sphinx.ext.coverage',
Joey Armstrongbbd71d62022-10-12 11:51:35 -040058 'sphinx.ext.extlinks',
Zack Williams071eda22019-05-15 18:19:51 -070059 'sphinx.ext.graphviz',
60 'sphinx.ext.ifconfig',
61 'sphinx.ext.mathjax',
62 'sphinx.ext.todo',
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",
Andrea Campanellac18d1182021-09-10 12:01:38 +020066 "sphinxcontrib.openapi",
Zack Williams071eda22019-05-15 18:19:51 -070067]
68
69# API documentation
70# https://github.com/rtfd/sphinx-autoapi
71# https://sphinx-autoapi.readthedocs.io
72# autoapi_type = 'go'
73# autoapi_dirs = [
74# 'voltha-go/cli/util',
75# 'voltha-go/rw_core/config',
76# 'voltha-go/rw_core/core',
77# 'voltha-go/rw_core/graph',
78# 'voltha-go/rw_core/utils',
79# ]
80
Zack Williamsc6460c22019-12-18 14:54:43 -070081# Text files with lists of words that shouldn't fail the spellchecker:
82spelling_word_list_filename=['dict.txt', ]
83
Joey Armstrongbbd71d62022-10-12 11:51:35 -040084#sphinx-multiversion prep, run in each versioned source directory
Zack Williams16042b62020-03-29 22:03:16 -070085prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070086 'ln -sf _root_/repos _target_/repos',
87 'make prep',
88]
89
Zack Williams6b2fcf22021-09-14 06:50:44 -070090# don't include tags
Joey Armstrong924f3cb2023-06-05 15:21:51 -040091# smv_tag_whitelist = None
92# smv_tag_whitelist = disabled^ # Was = None
93smv_tag_whitelist = 'disabled_a^' # Was = None
Zack Williams6b2fcf22021-09-14 06:50:44 -070094
Zack Williams76744322020-04-09 22:00:35 -070095# inlcude only the branches matching master and voltha-*
96smv_branch_whitelist = r'^(master|voltha-.*)$'
97
98# include all remote branches
99smv_remote_whitelist = r'^.*$'
100
Zack Williams071eda22019-05-15 18:19:51 -0700101# Add any paths that contain templates here, relative to this directory.
102templates_path = ['_templates']
103
104# The suffix(es) of source filenames.
105# You can specify multiple suffix as a list of string:
106#
107# source_suffix = ['.rst', '.md']
108source_suffix = ['.rst', '.md']
109
110# The master toctree document.
111master_doc = 'index'
112
113# The language for content autogenerated by Sphinx. Refer to documentation
114# for a list of supported languages.
115#
116# This is also used if you do content translation via gettext catalogs.
117# Usually you set "language" from the command line for these cases.
118language = None
119
120# List of patterns, relative to source directory, that match files and
121# directories to ignore when looking for source files.
122# This pattern also affects html_static_path and html_extra_path.
123exclude_patterns = [
124 '*/LICENSE.md',
Matteo Scandoloef5d6f42020-07-27 16:46:38 -0700125 '*/RELEASE_NOTES.md',
Zack Williams071eda22019-05-15 18:19:51 -0700126 '*/vendor',
127 '.DS_Store',
128 'Thumbs.db',
129 '_build',
Zack Williams16042b62020-03-29 22:03:16 -0700130 'voltha-go/BUILD.md',
Andy Bavier39d67b12020-02-27 16:08:52 -0700131 'cord-tester/venv_cord',
132 'cord-tester/docs',
133 'cord-tester/src',
134 'cord-tester/README.md',
135 'cord-tester/cord-robot/README.rst',
Zack Williams16042b62020-03-29 22:03:16 -0700136 'openolt/agent/*',
Zack Williams071eda22019-05-15 18:19:51 -0700137 'repos',
138 'requirements.txt',
139 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700140 'CODE_OF_CONDUCT.md',
141 '*/CODE_OF_CONDUCT.md',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500142# Ignore all:
Joey Armstrong4f93b762023-06-06 08:36:02 -0400143 'makefiles',
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400144 '__pycache__',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500145 '**/__pycache__', # generated - faster traversal
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400146 '.venv',
147 '**/.venv', # external virtual env
Joey Armstronga62c74a2022-11-23 13:16:34 -0500148# Revisit: one directory pattern is sufficient.
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400149 '**/doc_venv',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500150 '**/venv_docs',
151 '**/virtualenv',
152 '**/vst_venv',
Zack Williams071eda22019-05-15 18:19:51 -0700153]
154
155# The name of the Pygments (syntax highlighting) style to use.
156pygments_style = None
157
158# -- Options for HTML output -------------------------------------------------
159
160# The theme to use for HTML and HTML Help pages. See the documentation for
161# a list of builtin themes.
162#
163html_theme = 'sphinx_rtd_theme'
164
Zack Williams16042b62020-03-29 22:03:16 -0700165html_logo = '_static/voltha.svg'
166
167html_favicon = '_static/voltha-favicon-128.png'
168
Zack Williams071eda22019-05-15 18:19:51 -0700169# Theme options are theme-specific and customize the look and feel of a theme
170# further. For a list of options available for each theme, see the
171# documentation.
172#
Zack Williams16042b62020-03-29 22:03:16 -0700173html_theme_options = {
174 'logo_only': True
175}
Zack Williams071eda22019-05-15 18:19:51 -0700176
177# Add any paths that contain custom static files (such as style sheets) here,
178# relative to this directory. They are copied after the builtin static files,
179# so a file named "default.css" will overwrite the builtin "default.css".
180html_static_path = ['_static']
181
182# Custom sidebar templates, must be a dictionary that maps document names
183# to template names.
184#
185# The default sidebars (for documents that don't match any pattern) are
186# defined by theme itself. Builtin themes are using these templates by
187# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
188# 'searchbox.html']``.
189#
190# html_sidebars = {}
191
192
Zack Williams16042b62020-03-29 22:03:16 -0700193
Zack Williams071eda22019-05-15 18:19:51 -0700194# -- Options for HTMLHelp output ---------------------------------------------
195
196# Output file base name for HTML help builder.
197htmlhelp_basename = 'VOLTHADocs'
198
199
200# -- Options for LaTeX output ------------------------------------------------
201
202latex_elements = {
203 # The paper size ('letterpaper' or 'a4paper').
204 #
205 # 'papersize': 'letterpaper',
206
207 # The font size ('10pt', '11pt' or '12pt').
208 #
209 # 'pointsize': '10pt',
210
211 # Additional stuff for the LaTeX preamble.
212 #
213 # 'preamble': '',
214
215 # Latex figure (float) alignment
216 #
217 # 'figure_align': 'htbp',
218}
219
220# Grouping the document tree into LaTeX files. List of tuples
221# (source start file, target name, title,
222# author, documentclass [howto, manual, or own class]).
223latex_documents = [
224 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
225 u'VOLTHA Team', 'manual'),
226]
227
228
229# -- Options for manual page output ------------------------------------------
230
231# One entry per manual page. List of tuples
232# (source start file, name, description, authors, manual section).
233man_pages = [
234 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
235 [author], 1)
236]
237
238
239# -- Options for Texinfo output ----------------------------------------------
240
241# Grouping the document tree into Texinfo files. List of tuples
242# (source start file, target name, title, author,
243# dir menu entry, description, category)
244texinfo_documents = [
245 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
246 author, 'VOLTHADocs', 'One line description of project.',
247 'Miscellaneous'),
248]
249
250
251# -- Options for Epub output -------------------------------------------------
252
253# Bibliographic Dublin Core info.
254epub_title = project
255
256# The unique identifier of the text. This can be a ISBN number
257# or the project homepage.
258#
259# epub_identifier = ''
260
261# A unique identification for the text.
262#
263# epub_uid = ''
264
265# A list of files that should not be packed into the epub file.
266epub_exclude_files = ['search.html']
267
268
269# -- Extension configuration -------------------------------------------------
270
271# blockdiag/etc. config
272
273rackdiag_antialias = True
274rackdiag_html_image_format = "SVG"
275rackdiag_fontpath = [
276 "_static/fonts/Inconsolata-Regular.ttf",
277 "_static/fonts/Inconsolata-Bold.ttf",
278]
279
280nwdiag_antialias = True
281nwdiag_html_image_format = "SVG"
282nwdiag_fontpath = [
283 "_static/fonts/Inconsolata-Regular.ttf",
284 "_static/fonts/Inconsolata-Bold.ttf",
285]
286
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400287# -- Options for extlinks extension ------------------------------------------
288# ..seealso: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
289# 'vhc' : 'https://gerrit.opencord.org/plugins/gitiles/voltha-helm-charts',
Joey Armstrong56334fc2023-01-15 22:53:19 -0500290
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400291extlinks=\
292 {
293 'vol-jira' : ('https://jira.opencord.org/projects/VOL/issues/%s', 'jira::%s'),
Joey Armstrong56334fc2023-01-15 22:53:19 -0500294 # macros for gerrit or github URL construction
295 'repo' : ('https://github.com/opencord/%s', 'repo::%s'),
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400296 'vol-ger' : ('https://gerrit.opencord.org/plugins/gitiles/%s', 'gerrit::%s'),
297 'vol-git' : ('https://github.com/opencord/%s', 'git::%s'),
298 }
299
Joey Armstrong2a687952023-02-01 13:10:12 -0500300# -- Options for inlining a constant value -----------------------------------
301# NOTE: rst_prolog will affect every file in the repository.
302# Use per-file substitution to limit scope:
303# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
304# rst_prolog = """
305# .. |voltha-latest| replace:: voltha-2.11
306# """
307
Zack Williams071eda22019-05-15 18:19:51 -0700308# -- Options for todo extension ----------------------------------------------
309# If true, `todo` and `todoList` produce output, else they produce nothing.
310todo_include_todos = True
311
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100312# -- Options for linkcheck ---------------------------------------------------
313# The link checker strips off .md from links and then complains
Joey Armstrong36592e32022-11-28 09:00:28 -0500314linkcheck_ignore=\
315 [
316 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
317 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
318 r'https://www.sphinx-doc.org',
319 r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README',
320 r'https://github.com/opencord/voltha-helm-charts/blob/master/README',
321 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.9',
322 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.8',
Joey Armstrongf88b7382022-12-02 15:04:21 -0500323 #
324 r'../release_notes/voltha_2.2.html',
325 r'../release_notes/voltha_2.3.html',
326 r'../release_notes/voltha_2.4.html',
327 r'../release_notes/voltha_2.5.html',
328 r'../release_notes/voltha_2.6.html',
329 r'../release_notes/voltha_2.7.html',
330 r'../release_notes/voltha_2.8.html',
331 r'../release_notes/voltha_2.9.html',
332 r'../release_notes/voltha_2.10.html',
Joey Armstrong4044ed92022-12-21 19:01:49 -0500333 r'../release_notes/voltha_2.11.html',
Joey Armstrong7d32cbe2023-06-02 14:30:19 -0400334 r'../release_notes/voltha_2.12.html',
Joey Armstronga4d27232022-12-29 08:50:02 -0500335 #
336 r'../voltha-helm-charts/README.html',
Joey Armstrongab04e262023-06-13 14:32:35 -0400337 r'https://mvnrepository.com/artifact/org.slf4j/slf4j-api',
338 r'https://mvnrepository.com/artifact/org.mockito/mockito-all',
339 r'https://mvnrepository.com/artifact/com.h3xstream.findsecbugs/findsecbugs-plugin',
340 r'https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-maven-plugin',
Joey Armstrong36592e32022-11-28 09:00:28 -0500341 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100342
Zack Williams071eda22019-05-15 18:19:51 -0700343# -- Configure recommonmark to use AutoStructify -----------------------------
344# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
345
346import recommonmark
347from recommonmark.transform import AutoStructify
348
349github_doc_root = 'https://github.com/opencord/voltha-docs'
350
351def setup(app):
352
353 app.add_css_file('css/rtd_theme_mods.css')
354
355 app.add_config_value('recommonmark_config', {
356 'url_resolver': lambda url: github_doc_root + url,
357 'auto_toc_tree_section': 'Contents',
358 }, True)
359
360 app.add_transform(AutoStructify)