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