blob: 3f9d0756f45c1a72c43d6c54c680ce2b7cd67cf6 [file] [log] [blame]
Zack Williams071eda22019-05-15 18:19:51 -07001# -*- coding: utf-8 -*-
Joey Armstrong0c517b52023-07-07 17:29:54 -04002
Zack Williams071eda22019-05-15 18:19:51 -07003# 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 Armstrong0c517b52023-07-07 17:29:54 -040022# --------------------------------------------------------------
23# Large exclusion list(s) extracted from conf.py => .sphinx/*.py
24if True: # Set searchpath early
25 abs_path = Path('.').resolve().as_posix()
26 sys.path.insert(0, abs_path)
27
28# from sphinx_conf import *
29from sphinx_conf.exclude_patterns import exclude_patterns
30from sphinx_conf.linkcheck_ignore import linkcheck_ignore
31# --------------------------------------------------------------
Joey Armstrong56334fc2023-01-15 22:53:19 -050032
33# -----------------------------------------------------------------------
34# -----------------------------------------------------------------------
Zack Williams16042b62020-03-29 22:03:16 -070035def get_version():
36 with open("VERSION") as f:
37 return f.read().strip()
38
Zack Williams071eda22019-05-15 18:19:51 -070039# -- Project information -----------------------------------------------------
40
41project = u'VOLTHA Docs'
Joey Armstrong56334fc2023-01-15 22:53:19 -050042copyright = u'Copyright 2019-2023 Open Networking Foundation (ONF) and the ONF Contributors'
Zack Williams071eda22019-05-15 18:19:51 -070043author = u'VOLTHA Contributors'
44
45# The short X.Y version
Zack Williams16042b62020-03-29 22:03:16 -070046version = get_version()
Zack Williams071eda22019-05-15 18:19:51 -070047# The full version, including alpha/beta/rc tags
Zack Williams88df4742019-12-20 08:24:47 -070048release = version
Zack Williams071eda22019-05-15 18:19:51 -070049
50# -- General configuration ---------------------------------------------------
51
52# If your documentation needs a minimal Sphinx version, state it here.
53#
54# needs_sphinx = '1.0'
55
56# make all warnings errors
57warning_is_error = True
58
59# Add any Sphinx extension module names here, as strings. They can be
60# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
61# ones.
62extensions = [
63 'recommonmark',
64 'sphinx.ext.coverage',
Joey Armstrongbbd71d62022-10-12 11:51:35 -040065 'sphinx.ext.extlinks',
Zack Williams071eda22019-05-15 18:19:51 -070066 'sphinx.ext.graphviz',
67 'sphinx.ext.ifconfig',
Joey Armstrong3980d702023-08-23 10:57:18 -040068# 'sphinx.ext.intersphinx', # :doc:`my document <../my_doc{.rst}>`
Zack Williams071eda22019-05-15 18:19:51 -070069 'sphinx.ext.mathjax',
70 'sphinx.ext.todo',
Zack Williamsc6460c22019-12-18 14:54:43 -070071 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070072 "sphinx_multiversion",
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070073 "sphinx.ext.intersphinx",
Andrea Campanellac18d1182021-09-10 12:01:38 +020074 "sphinxcontrib.openapi",
Zack Williams071eda22019-05-15 18:19:51 -070075]
76
77# API documentation
78# https://github.com/rtfd/sphinx-autoapi
79# https://sphinx-autoapi.readthedocs.io
80# autoapi_type = 'go'
81# autoapi_dirs = [
82# 'voltha-go/cli/util',
83# 'voltha-go/rw_core/config',
84# 'voltha-go/rw_core/core',
85# 'voltha-go/rw_core/graph',
86# 'voltha-go/rw_core/utils',
87# ]
88
Zack Williamsc6460c22019-12-18 14:54:43 -070089# Text files with lists of words that shouldn't fail the spellchecker:
90spelling_word_list_filename=['dict.txt', ]
91
Joey Armstrongbbd71d62022-10-12 11:51:35 -040092#sphinx-multiversion prep, run in each versioned source directory
Zack Williams16042b62020-03-29 22:03:16 -070093prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070094 'ln -sf _root_/repos _target_/repos',
95 'make prep',
96]
97
Zack Williams6b2fcf22021-09-14 06:50:44 -070098# don't include tags
Joey Armstrong924f3cb2023-06-05 15:21:51 -040099# smv_tag_whitelist = None
100# smv_tag_whitelist = disabled^ # Was = None
101smv_tag_whitelist = 'disabled_a^' # Was = None
Zack Williams6b2fcf22021-09-14 06:50:44 -0700102
Zack Williams76744322020-04-09 22:00:35 -0700103# inlcude only the branches matching master and voltha-*
104smv_branch_whitelist = r'^(master|voltha-.*)$'
105
106# include all remote branches
107smv_remote_whitelist = r'^.*$'
108
Zack Williams071eda22019-05-15 18:19:51 -0700109# Add any paths that contain templates here, relative to this directory.
110templates_path = ['_templates']
111
112# The suffix(es) of source filenames.
113# You can specify multiple suffix as a list of string:
114#
115# source_suffix = ['.rst', '.md']
116source_suffix = ['.rst', '.md']
117
118# The master toctree document.
119master_doc = 'index'
120
121# The language for content autogenerated by Sphinx. Refer to documentation
122# for a list of supported languages.
123#
124# This is also used if you do content translation via gettext catalogs.
125# Usually you set "language" from the command line for these cases.
126language = None
127
Zack Williams071eda22019-05-15 18:19:51 -0700128# The name of the Pygments (syntax highlighting) style to use.
129pygments_style = None
130
131# -- Options for HTML output -------------------------------------------------
132
133# The theme to use for HTML and HTML Help pages. See the documentation for
134# a list of builtin themes.
135#
136html_theme = 'sphinx_rtd_theme'
137
Zack Williams16042b62020-03-29 22:03:16 -0700138html_logo = '_static/voltha.svg'
139
140html_favicon = '_static/voltha-favicon-128.png'
141
Zack Williams071eda22019-05-15 18:19:51 -0700142# Theme options are theme-specific and customize the look and feel of a theme
143# further. For a list of options available for each theme, see the
144# documentation.
145#
Zack Williams16042b62020-03-29 22:03:16 -0700146html_theme_options = {
147 'logo_only': True
148}
Zack Williams071eda22019-05-15 18:19:51 -0700149
150# Add any paths that contain custom static files (such as style sheets) here,
151# relative to this directory. They are copied after the builtin static files,
152# so a file named "default.css" will overwrite the builtin "default.css".
153html_static_path = ['_static']
154
155# Custom sidebar templates, must be a dictionary that maps document names
156# to template names.
157#
158# The default sidebars (for documents that don't match any pattern) are
159# defined by theme itself. Builtin themes are using these templates by
160# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
161# 'searchbox.html']``.
162#
163# html_sidebars = {}
164
165
Zack Williams16042b62020-03-29 22:03:16 -0700166
Zack Williams071eda22019-05-15 18:19:51 -0700167# -- Options for HTMLHelp output ---------------------------------------------
168
169# Output file base name for HTML help builder.
170htmlhelp_basename = 'VOLTHADocs'
171
172
173# -- Options for LaTeX output ------------------------------------------------
174
175latex_elements = {
176 # The paper size ('letterpaper' or 'a4paper').
177 #
178 # 'papersize': 'letterpaper',
179
180 # The font size ('10pt', '11pt' or '12pt').
181 #
182 # 'pointsize': '10pt',
183
184 # Additional stuff for the LaTeX preamble.
185 #
186 # 'preamble': '',
187
188 # Latex figure (float) alignment
189 #
190 # 'figure_align': 'htbp',
191}
192
193# Grouping the document tree into LaTeX files. List of tuples
194# (source start file, target name, title,
195# author, documentclass [howto, manual, or own class]).
196latex_documents = [
197 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
198 u'VOLTHA Team', 'manual'),
199]
200
201
202# -- Options for manual page output ------------------------------------------
203
204# One entry per manual page. List of tuples
205# (source start file, name, description, authors, manual section).
206man_pages = [
207 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
208 [author], 1)
209]
210
211
212# -- Options for Texinfo output ----------------------------------------------
213
214# Grouping the document tree into Texinfo files. List of tuples
215# (source start file, target name, title, author,
216# dir menu entry, description, category)
217texinfo_documents = [
218 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
219 author, 'VOLTHADocs', 'One line description of project.',
220 'Miscellaneous'),
221]
222
223
224# -- Options for Epub output -------------------------------------------------
225
226# Bibliographic Dublin Core info.
227epub_title = project
228
229# The unique identifier of the text. This can be a ISBN number
230# or the project homepage.
231#
232# epub_identifier = ''
233
234# A unique identification for the text.
235#
236# epub_uid = ''
237
238# A list of files that should not be packed into the epub file.
239epub_exclude_files = ['search.html']
240
241
242# -- Extension configuration -------------------------------------------------
243
244# blockdiag/etc. config
245
246rackdiag_antialias = True
247rackdiag_html_image_format = "SVG"
248rackdiag_fontpath = [
249 "_static/fonts/Inconsolata-Regular.ttf",
250 "_static/fonts/Inconsolata-Bold.ttf",
251]
252
253nwdiag_antialias = True
254nwdiag_html_image_format = "SVG"
255nwdiag_fontpath = [
256 "_static/fonts/Inconsolata-Regular.ttf",
257 "_static/fonts/Inconsolata-Bold.ttf",
258]
259
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400260# -- Options for extlinks extension ------------------------------------------
261# ..seealso: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
262# 'vhc' : 'https://gerrit.opencord.org/plugins/gitiles/voltha-helm-charts',
Joey Armstrong56334fc2023-01-15 22:53:19 -0500263
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400264extlinks=\
265 {
266 'vol-jira' : ('https://jira.opencord.org/projects/VOL/issues/%s', 'jira::%s'),
Joey Armstrong56334fc2023-01-15 22:53:19 -0500267 # macros for gerrit or github URL construction
268 'repo' : ('https://github.com/opencord/%s', 'repo::%s'),
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400269 'vol-ger' : ('https://gerrit.opencord.org/plugins/gitiles/%s', 'gerrit::%s'),
270 'vol-git' : ('https://github.com/opencord/%s', 'git::%s'),
271 }
272
Joey Armstrong2a687952023-02-01 13:10:12 -0500273# -- Options for inlining a constant value -----------------------------------
274# NOTE: rst_prolog will affect every file in the repository.
275# Use per-file substitution to limit scope:
276# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
277# rst_prolog = """
278# .. |voltha-latest| replace:: voltha-2.11
279# """
280
Zack Williams071eda22019-05-15 18:19:51 -0700281# -- Options for todo extension ----------------------------------------------
282# If true, `todo` and `todoList` produce output, else they produce nothing.
283todo_include_todos = True
284
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100285# -- Options for linkcheck ---------------------------------------------------
286# The link checker strips off .md from links and then complains
Joey Armstrong0c517b52023-07-07 17:29:54 -0400287# linkcheck_ignore SEE .sphinx/linkcheck_ignore.py
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)