blob: 2e6b04d368a1cd8aee1002a397517a76f7a11e7d [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 Williams16042b62020-03-29 22:03:16 -070028copyright = u'2019-2020, 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',
56 'sphinxcontrib.actdiag',
57 'sphinxcontrib.blockdiag',
58 'sphinxcontrib.nwdiag',
59 'sphinxcontrib.openapi',
60 'sphinxcontrib.packetdiag',
61 'sphinxcontrib.rackdiag',
62 'sphinxcontrib.seqdiag',
Zack Williamsc6460c22019-12-18 14:54:43 -070063 'sphinxcontrib.spelling',
Zack Williams16042b62020-03-29 22:03:16 -070064 "sphinx_multiversion",
Zack Williams071eda22019-05-15 18:19:51 -070065# 'sphinxcontrib.golangdomain',
66# 'autoapi.extension',
67]
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
Zack Williams16042b62020-03-29 22:03:16 -070084# sphinx-multiversion prep, run in each versioned source directory
85prep_commands = [
Zack Williams88df4742019-12-20 08:24:47 -070086 'ln -sf _root_/repos _target_/repos',
87 'make prep',
88]
89
Zack Williams76744322020-04-09 22:00:35 -070090# inlcude only the branches matching master and voltha-*
91smv_branch_whitelist = r'^(master|voltha-.*)$'
92
93# include all remote branches
94smv_remote_whitelist = r'^.*$'
95
Zack Williams071eda22019-05-15 18:19:51 -070096# Add any paths that contain templates here, relative to this directory.
97templates_path = ['_templates']
98
99# The suffix(es) of source filenames.
100# You can specify multiple suffix as a list of string:
101#
102# source_suffix = ['.rst', '.md']
103source_suffix = ['.rst', '.md']
104
105# The master toctree document.
106master_doc = 'index'
107
108# The language for content autogenerated by Sphinx. Refer to documentation
109# for a list of supported languages.
110#
111# This is also used if you do content translation via gettext catalogs.
112# Usually you set "language" from the command line for these cases.
113language = None
114
115# List of patterns, relative to source directory, that match files and
116# directories to ignore when looking for source files.
117# This pattern also affects html_static_path and html_extra_path.
118exclude_patterns = [
119 '*/LICENSE.md',
120 '*/vendor',
121 '.DS_Store',
122 'Thumbs.db',
123 '_build',
Zack Williams16042b62020-03-29 22:03:16 -0700124 'venv_docs',
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100125 'voltha-system-tests/vst_venv',
Zack Williams16042b62020-03-29 22:03:16 -0700126 'voltha-go/BUILD.md',
Andy Bavier39d67b12020-02-27 16:08:52 -0700127 'cord-tester/venv_cord',
128 'cord-tester/docs',
129 'cord-tester/src',
130 'cord-tester/README.md',
131 'cord-tester/cord-robot/README.rst',
Zack Williams16042b62020-03-29 22:03:16 -0700132 'openolt/agent/*',
Zack Williams071eda22019-05-15 18:19:51 -0700133 'repos',
134 'requirements.txt',
135 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700136 'CODE_OF_CONDUCT.md',
137 '*/CODE_OF_CONDUCT.md',
Zack Williams071eda22019-05-15 18:19:51 -0700138]
139
140# The name of the Pygments (syntax highlighting) style to use.
141pygments_style = None
142
143# -- Options for HTML output -------------------------------------------------
144
145# The theme to use for HTML and HTML Help pages. See the documentation for
146# a list of builtin themes.
147#
148html_theme = 'sphinx_rtd_theme'
149
Zack Williams16042b62020-03-29 22:03:16 -0700150html_logo = '_static/voltha.svg'
151
152html_favicon = '_static/voltha-favicon-128.png'
153
Zack Williams071eda22019-05-15 18:19:51 -0700154# Theme options are theme-specific and customize the look and feel of a theme
155# further. For a list of options available for each theme, see the
156# documentation.
157#
Zack Williams16042b62020-03-29 22:03:16 -0700158html_theme_options = {
159 'logo_only': True
160}
Zack Williams071eda22019-05-15 18:19:51 -0700161
162# Add any paths that contain custom static files (such as style sheets) here,
163# relative to this directory. They are copied after the builtin static files,
164# so a file named "default.css" will overwrite the builtin "default.css".
165html_static_path = ['_static']
166
167# Custom sidebar templates, must be a dictionary that maps document names
168# to template names.
169#
170# The default sidebars (for documents that don't match any pattern) are
171# defined by theme itself. Builtin themes are using these templates by
172# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
173# 'searchbox.html']``.
174#
175# html_sidebars = {}
176
177
Zack Williams16042b62020-03-29 22:03:16 -0700178
Zack Williams071eda22019-05-15 18:19:51 -0700179# -- Options for HTMLHelp output ---------------------------------------------
180
181# Output file base name for HTML help builder.
182htmlhelp_basename = 'VOLTHADocs'
183
184
185# -- Options for LaTeX output ------------------------------------------------
186
187latex_elements = {
188 # The paper size ('letterpaper' or 'a4paper').
189 #
190 # 'papersize': 'letterpaper',
191
192 # The font size ('10pt', '11pt' or '12pt').
193 #
194 # 'pointsize': '10pt',
195
196 # Additional stuff for the LaTeX preamble.
197 #
198 # 'preamble': '',
199
200 # Latex figure (float) alignment
201 #
202 # 'figure_align': 'htbp',
203}
204
205# Grouping the document tree into LaTeX files. List of tuples
206# (source start file, target name, title,
207# author, documentclass [howto, manual, or own class]).
208latex_documents = [
209 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
210 u'VOLTHA Team', 'manual'),
211]
212
213
214# -- Options for manual page output ------------------------------------------
215
216# One entry per manual page. List of tuples
217# (source start file, name, description, authors, manual section).
218man_pages = [
219 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
220 [author], 1)
221]
222
223
224# -- Options for Texinfo output ----------------------------------------------
225
226# Grouping the document tree into Texinfo files. List of tuples
227# (source start file, target name, title, author,
228# dir menu entry, description, category)
229texinfo_documents = [
230 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
231 author, 'VOLTHADocs', 'One line description of project.',
232 'Miscellaneous'),
233]
234
235
236# -- Options for Epub output -------------------------------------------------
237
238# Bibliographic Dublin Core info.
239epub_title = project
240
241# The unique identifier of the text. This can be a ISBN number
242# or the project homepage.
243#
244# epub_identifier = ''
245
246# A unique identification for the text.
247#
248# epub_uid = ''
249
250# A list of files that should not be packed into the epub file.
251epub_exclude_files = ['search.html']
252
253
254# -- Extension configuration -------------------------------------------------
255
256# blockdiag/etc. config
257
258rackdiag_antialias = True
259rackdiag_html_image_format = "SVG"
260rackdiag_fontpath = [
261 "_static/fonts/Inconsolata-Regular.ttf",
262 "_static/fonts/Inconsolata-Bold.ttf",
263]
264
265nwdiag_antialias = True
266nwdiag_html_image_format = "SVG"
267nwdiag_fontpath = [
268 "_static/fonts/Inconsolata-Regular.ttf",
269 "_static/fonts/Inconsolata-Bold.ttf",
270]
271
272# -- Options for todo extension ----------------------------------------------
273# If true, `todo` and `todoList` produce output, else they produce nothing.
274todo_include_todos = True
275
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100276# -- Options for linkcheck ---------------------------------------------------
277# The link checker strips off .md from links and then complains
278linkcheck_ignore = [r'https://github.com/ciena/kind-voltha/blob/master/README',
279 r'https://github.com/opencord/voltctl/blob/master/LICENSE',
Zack Williams16042b62020-03-29 22:03:16 -0700280 r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options',
281 r'https://www.sphinx-doc.org',
282 ]
Andrea Campanella92bd59b2020-01-30 17:26:32 +0100283
Zack Williams071eda22019-05-15 18:19:51 -0700284# -- Configure recommonmark to use AutoStructify -----------------------------
285# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
286
287import recommonmark
288from recommonmark.transform import AutoStructify
289
290github_doc_root = 'https://github.com/opencord/voltha-docs'
291
292def setup(app):
293
294 app.add_css_file('css/rtd_theme_mods.css')
295
296 app.add_config_value('recommonmark_config', {
297 'url_resolver': lambda url: github_doc_root + url,
298 'auto_toc_tree_section': 'Contents',
299 }, True)
300
301 app.add_transform(AutoStructify)