blob: e98cf6138651181ff3092543524ed5336eebe02a [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',
68 'sphinx.ext.mathjax',
69 'sphinx.ext.todo',
Zack Williamsc6460c22019-12-18 14:54:43 -070070 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070071 "sphinx_multiversion",
Matteo Scandoloef5d6f42020-07-27 16:46:38 -070072 "sphinx.ext.intersphinx",
Andrea Campanellac18d1182021-09-10 12:01:38 +020073 "sphinxcontrib.openapi",
Zack Williams071eda22019-05-15 18:19:51 -070074]
75
76# API documentation
77# https://github.com/rtfd/sphinx-autoapi
78# https://sphinx-autoapi.readthedocs.io
79# autoapi_type = 'go'
80# autoapi_dirs = [
81# 'voltha-go/cli/util',
82# 'voltha-go/rw_core/config',
83# 'voltha-go/rw_core/core',
84# 'voltha-go/rw_core/graph',
85# 'voltha-go/rw_core/utils',
86# ]
87
Zack Williamsc6460c22019-12-18 14:54:43 -070088# Text files with lists of words that shouldn't fail the spellchecker:
89spelling_word_list_filename=['dict.txt', ]
90
Joey Armstrongbbd71d62022-10-12 11:51:35 -040091#sphinx-multiversion prep, run in each versioned source directory
Zack Williams16042b62020-03-29 22:03:16 -070092prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070093 'ln -sf _root_/repos _target_/repos',
94 'make prep',
95]
96
Zack Williams6b2fcf22021-09-14 06:50:44 -070097# don't include tags
Joey Armstrong924f3cb2023-06-05 15:21:51 -040098# smv_tag_whitelist = None
99# smv_tag_whitelist = disabled^ # Was = None
100smv_tag_whitelist = 'disabled_a^' # Was = None
Zack Williams6b2fcf22021-09-14 06:50:44 -0700101
Zack Williams76744322020-04-09 22:00:35 -0700102# inlcude only the branches matching master and voltha-*
103smv_branch_whitelist = r'^(master|voltha-.*)$'
104
105# include all remote branches
106smv_remote_whitelist = r'^.*$'
107
Zack Williams071eda22019-05-15 18:19:51 -0700108# Add any paths that contain templates here, relative to this directory.
109templates_path = ['_templates']
110
111# The suffix(es) of source filenames.
112# You can specify multiple suffix as a list of string:
113#
114# source_suffix = ['.rst', '.md']
115source_suffix = ['.rst', '.md']
116
117# The master toctree document.
118master_doc = 'index'
119
120# The language for content autogenerated by Sphinx. Refer to documentation
121# for a list of supported languages.
122#
123# This is also used if you do content translation via gettext catalogs.
124# Usually you set "language" from the command line for these cases.
125language = None
126
Zack Williams071eda22019-05-15 18:19:51 -0700127# The name of the Pygments (syntax highlighting) style to use.
128pygments_style = None
129
130# -- Options for HTML output -------------------------------------------------
131
132# The theme to use for HTML and HTML Help pages. See the documentation for
133# a list of builtin themes.
134#
135html_theme = 'sphinx_rtd_theme'
136
Zack Williams16042b62020-03-29 22:03:16 -0700137html_logo = '_static/voltha.svg'
138
139html_favicon = '_static/voltha-favicon-128.png'
140
Zack Williams071eda22019-05-15 18:19:51 -0700141# Theme options are theme-specific and customize the look and feel of a theme
142# further. For a list of options available for each theme, see the
143# documentation.
144#
Zack Williams16042b62020-03-29 22:03:16 -0700145html_theme_options = {
146 'logo_only': True
147}
Zack Williams071eda22019-05-15 18:19:51 -0700148
149# Add any paths that contain custom static files (such as style sheets) here,
150# relative to this directory. They are copied after the builtin static files,
151# so a file named "default.css" will overwrite the builtin "default.css".
152html_static_path = ['_static']
153
154# Custom sidebar templates, must be a dictionary that maps document names
155# to template names.
156#
157# The default sidebars (for documents that don't match any pattern) are
158# defined by theme itself. Builtin themes are using these templates by
159# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
160# 'searchbox.html']``.
161#
162# html_sidebars = {}
163
164
Zack Williams16042b62020-03-29 22:03:16 -0700165
Zack Williams071eda22019-05-15 18:19:51 -0700166# -- Options for HTMLHelp output ---------------------------------------------
167
168# Output file base name for HTML help builder.
169htmlhelp_basename = 'VOLTHADocs'
170
171
172# -- Options for LaTeX output ------------------------------------------------
173
174latex_elements = {
175 # The paper size ('letterpaper' or 'a4paper').
176 #
177 # 'papersize': 'letterpaper',
178
179 # The font size ('10pt', '11pt' or '12pt').
180 #
181 # 'pointsize': '10pt',
182
183 # Additional stuff for the LaTeX preamble.
184 #
185 # 'preamble': '',
186
187 # Latex figure (float) alignment
188 #
189 # 'figure_align': 'htbp',
190}
191
192# Grouping the document tree into LaTeX files. List of tuples
193# (source start file, target name, title,
194# author, documentclass [howto, manual, or own class]).
195latex_documents = [
196 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
197 u'VOLTHA Team', 'manual'),
198]
199
200
201# -- Options for manual page output ------------------------------------------
202
203# One entry per manual page. List of tuples
204# (source start file, name, description, authors, manual section).
205man_pages = [
206 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
207 [author], 1)
208]
209
210
211# -- Options for Texinfo output ----------------------------------------------
212
213# Grouping the document tree into Texinfo files. List of tuples
214# (source start file, target name, title, author,
215# dir menu entry, description, category)
216texinfo_documents = [
217 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
218 author, 'VOLTHADocs', 'One line description of project.',
219 'Miscellaneous'),
220]
221
222
223# -- Options for Epub output -------------------------------------------------
224
225# Bibliographic Dublin Core info.
226epub_title = project
227
228# The unique identifier of the text. This can be a ISBN number
229# or the project homepage.
230#
231# epub_identifier = ''
232
233# A unique identification for the text.
234#
235# epub_uid = ''
236
237# A list of files that should not be packed into the epub file.
238epub_exclude_files = ['search.html']
239
240
241# -- Extension configuration -------------------------------------------------
242
243# blockdiag/etc. config
244
245rackdiag_antialias = True
246rackdiag_html_image_format = "SVG"
247rackdiag_fontpath = [
248 "_static/fonts/Inconsolata-Regular.ttf",
249 "_static/fonts/Inconsolata-Bold.ttf",
250]
251
252nwdiag_antialias = True
253nwdiag_html_image_format = "SVG"
254nwdiag_fontpath = [
255 "_static/fonts/Inconsolata-Regular.ttf",
256 "_static/fonts/Inconsolata-Bold.ttf",
257]
258
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400259# -- Options for extlinks extension ------------------------------------------
260# ..seealso: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
261# 'vhc' : 'https://gerrit.opencord.org/plugins/gitiles/voltha-helm-charts',
Joey Armstrong56334fc2023-01-15 22:53:19 -0500262
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400263extlinks=\
264 {
265 'vol-jira' : ('https://jira.opencord.org/projects/VOL/issues/%s', 'jira::%s'),
Joey Armstrong56334fc2023-01-15 22:53:19 -0500266 # macros for gerrit or github URL construction
267 'repo' : ('https://github.com/opencord/%s', 'repo::%s'),
Joey Armstrongbbd71d62022-10-12 11:51:35 -0400268 'vol-ger' : ('https://gerrit.opencord.org/plugins/gitiles/%s', 'gerrit::%s'),
269 'vol-git' : ('https://github.com/opencord/%s', 'git::%s'),
270 }
271
Joey Armstrong2a687952023-02-01 13:10:12 -0500272# -- Options for inlining a constant value -----------------------------------
273# NOTE: rst_prolog will affect every file in the repository.
274# Use per-file substitution to limit scope:
275# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
276# rst_prolog = """
277# .. |voltha-latest| replace:: voltha-2.11
278# """
279
Zack Williams071eda22019-05-15 18:19:51 -0700280# -- Options for todo extension ----------------------------------------------
281# If true, `todo` and `todoList` produce output, else they produce nothing.
282todo_include_todos = True
283
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100284# -- Options for linkcheck ---------------------------------------------------
285# The link checker strips off .md from links and then complains
Joey Armstrong0c517b52023-07-07 17:29:54 -0400286# linkcheck_ignore SEE .sphinx/linkcheck_ignore.py
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100287
Zack Williams071eda22019-05-15 18:19:51 -0700288# -- Configure recommonmark to use AutoStructify -----------------------------
289# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
290
291import recommonmark
292from recommonmark.transform import AutoStructify
293
294github_doc_root = 'https://github.com/opencord/voltha-docs'
295
296def setup(app):
297
298 app.add_css_file('css/rtd_theme_mods.css')
299
300 app.add_config_value('recommonmark_config', {
301 'url_resolver': lambda url: github_doc_root + url,
302 'auto_toc_tree_section': 'Contents',
303 }, True)
304
305 app.add_transform(AutoStructify)