blob: 9290b6f07acb628389eada1b789fef5fcc6f0768 [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 Armstrong924f3cb2023-06-05 15:21:51 -0400143 '__pycache__',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500144 '**/__pycache__', # generated - faster traversal
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400145 '.venv',
146 '**/.venv', # external virtual env
Joey Armstronga62c74a2022-11-23 13:16:34 -0500147# Revisit: one directory pattern is sufficient.
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400148 '**/doc_venv',
Joey Armstronga62c74a2022-11-23 13:16:34 -0500149 '**/venv_docs',
150 '**/virtualenv',
151 '**/vst_venv',
Zack Williams071eda22019-05-15 18:19:51 -0700152]
153
154# The name of the Pygments (syntax highlighting) style to use.
155pygments_style = None
156
157# -- Options for HTML output -------------------------------------------------
158
159# The theme to use for HTML and HTML Help pages. See the documentation for
160# a list of builtin themes.
161#
162html_theme = 'sphinx_rtd_theme'
163
Zack Williams16042b62020-03-29 22:03:16 -0700164html_logo = '_static/voltha.svg'
165
166html_favicon = '_static/voltha-favicon-128.png'
167
Zack Williams071eda22019-05-15 18:19:51 -0700168# Theme options are theme-specific and customize the look and feel of a theme
169# further. For a list of options available for each theme, see the
170# documentation.
171#
Zack Williams16042b62020-03-29 22:03:16 -0700172html_theme_options = {
173 'logo_only': True
174}
Zack Williams071eda22019-05-15 18:19:51 -0700175
176# Add any paths that contain custom static files (such as style sheets) here,
177# relative to this directory. They are copied after the builtin static files,
178# so a file named "default.css" will overwrite the builtin "default.css".
179html_static_path = ['_static']
180
181# Custom sidebar templates, must be a dictionary that maps document names
182# to template names.
183#
184# The default sidebars (for documents that don't match any pattern) are
185# defined by theme itself. Builtin themes are using these templates by
186# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
187# 'searchbox.html']``.
188#
189# html_sidebars = {}
190
191
Zack Williams16042b62020-03-29 22:03:16 -0700192
Zack Williams071eda22019-05-15 18:19:51 -0700193# -- Options for HTMLHelp output ---------------------------------------------
194
195# Output file base name for HTML help builder.
196htmlhelp_basename = 'VOLTHADocs'
197
198
199# -- Options for LaTeX output ------------------------------------------------
200
201latex_elements = {
202 # The paper size ('letterpaper' or 'a4paper').
203 #
204 # 'papersize': 'letterpaper',
205
206 # The font size ('10pt', '11pt' or '12pt').
207 #
208 # 'pointsize': '10pt',
209
210 # Additional stuff for the LaTeX preamble.
211 #
212 # 'preamble': '',
213
214 # Latex figure (float) alignment
215 #
216 # 'figure_align': 'htbp',
217}
218
219# Grouping the document tree into LaTeX files. List of tuples
220# (source start file, target name, title,
221# author, documentclass [howto, manual, or own class]).
222latex_documents = [
223 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
224 u'VOLTHA Team', 'manual'),
225]
226
227
228# -- Options for manual page output ------------------------------------------
229
230# One entry per manual page. List of tuples
231# (source start file, name, description, authors, manual section).
232man_pages = [
233 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
234 [author], 1)
235]
236
237
238# -- Options for Texinfo output ----------------------------------------------
239
240# Grouping the document tree into Texinfo files. List of tuples
241# (source start file, target name, title, author,
242# dir menu entry, description, category)
243texinfo_documents = [
244 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
245 author, 'VOLTHADocs', 'One line description of project.',
246 'Miscellaneous'),
247]
248
249
250# -- Options for Epub output -------------------------------------------------
251
252# Bibliographic Dublin Core info.
253epub_title = project
254
255# The unique identifier of the text. This can be a ISBN number
256# or the project homepage.
257#
258# epub_identifier = ''
259
260# A unique identification for the text.
261#
262# epub_uid = ''
263
264# A list of files that should not be packed into the epub file.
265epub_exclude_files = ['search.html']
266
267
268# -- Extension configuration -------------------------------------------------
269
270# blockdiag/etc. config
271
272rackdiag_antialias = True
273rackdiag_html_image_format = "SVG"
274rackdiag_fontpath = [
275 "_static/fonts/Inconsolata-Regular.ttf",
276 "_static/fonts/Inconsolata-Bold.ttf",
277]
278
279nwdiag_antialias = True
280nwdiag_html_image_format = "SVG"
281nwdiag_fontpath = [
282 "_static/fonts/Inconsolata-Regular.ttf",
283 "_static/fonts/Inconsolata-Bold.ttf",
284]
285
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400286# -- Options for extlinks extension ------------------------------------------
287# ..seealso: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
288# 'vhc' : 'https://gerrit.opencord.org/plugins/gitiles/voltha-helm-charts',
Joey Armstrong56334fc2023-01-15 22:53:19 -0500289
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400290extlinks=\
291 {
292 'vol-jira' : ('https://jira.opencord.org/projects/VOL/issues/%s', 'jira::%s'),
Joey Armstrong56334fc2023-01-15 22:53:19 -0500293 # macros for gerrit or github URL construction
294 'repo' : ('https://github.com/opencord/%s', 'repo::%s'),
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400295 'vol-ger' : ('https://gerrit.opencord.org/plugins/gitiles/%s', 'gerrit::%s'),
296 'vol-git' : ('https://github.com/opencord/%s', 'git::%s'),
297 }
298
Joey Armstrong2a687952023-02-01 13:10:12 -0500299# -- Options for inlining a constant value -----------------------------------
300# NOTE: rst_prolog will affect every file in the repository.
301# Use per-file substitution to limit scope:
302# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
303# rst_prolog = """
304# .. |voltha-latest| replace:: voltha-2.11
305# """
306
Zack Williams071eda22019-05-15 18:19:51 -0700307# -- Options for todo extension ----------------------------------------------
308# If true, `todo` and `todoList` produce output, else they produce nothing.
309todo_include_todos = True
310
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100311# -- Options for linkcheck ---------------------------------------------------
312# The link checker strips off .md from links and then complains
Joey Armstrong36592e32022-11-28 09:00:28 -0500313linkcheck_ignore=\
314 [
315 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
316 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
317 r'https://www.sphinx-doc.org',
318 r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README',
319 r'https://github.com/opencord/voltha-helm-charts/blob/master/README',
320 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.9',
321 r'https://github.com/atomix/atomix/releases/tag/atomix-3.1.8',
Joey Armstrongf88b7382022-12-02 15:04:21 -0500322 #
323 r'../release_notes/voltha_2.2.html',
324 r'../release_notes/voltha_2.3.html',
325 r'../release_notes/voltha_2.4.html',
326 r'../release_notes/voltha_2.5.html',
327 r'../release_notes/voltha_2.6.html',
328 r'../release_notes/voltha_2.7.html',
329 r'../release_notes/voltha_2.8.html',
330 r'../release_notes/voltha_2.9.html',
331 r'../release_notes/voltha_2.10.html',
Joey Armstrong4044ed92022-12-21 19:01:49 -0500332 r'../release_notes/voltha_2.11.html',
Joey Armstrong7d32cbe2023-06-02 14:30:19 -0400333 r'../release_notes/voltha_2.12.html',
Joey Armstronga4d27232022-12-29 08:50:02 -0500334 #
335 r'../voltha-helm-charts/README.html',
Joey Armstrong36592e32022-11-28 09:00:28 -0500336 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100337
Zack Williams071eda22019-05-15 18:19:51 -0700338# -- Configure recommonmark to use AutoStructify -----------------------------
339# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
340
341import recommonmark
342from recommonmark.transform import AutoStructify
343
344github_doc_root = 'https://github.com/opencord/voltha-docs'
345
346def setup(app):
347
348 app.add_css_file('css/rtd_theme_mods.css')
349
350 app.add_config_value('recommonmark_config', {
351 'url_resolver': lambda url: github_doc_root + url,
352 'auto_toc_tree_section': 'Contents',
353 }, True)
354
355 app.add_transform(AutoStructify)