blob: ce7ea519f606fefa6f86c99bef4069751f5a893f [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
19import os
20
21def get_version():
22 with open("VERSION") as f:
23 return f.read().strip()
24
25# -- Project information -----------------------------------------------------
26
27project = u'VOLTHA Docs'
28copyright = u'2019, VOLTHA Contributors'
29author = u'VOLTHA Contributors'
30
31# The short X.Y version
32version = get_version()
33
34# The full version, including alpha/beta/rc tags
35release = get_version()
36
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',
63# 'sphinxcontrib.golangdomain',
64# 'autoapi.extension',
65]
66
67# API documentation
68# https://github.com/rtfd/sphinx-autoapi
69# https://sphinx-autoapi.readthedocs.io
70# autoapi_type = 'go'
71# autoapi_dirs = [
72# 'voltha-go/cli/util',
73# 'voltha-go/rw_core/config',
74# 'voltha-go/rw_core/core',
75# 'voltha-go/rw_core/graph',
76# 'voltha-go/rw_core/utils',
77# ]
78
79# Add any paths that contain templates here, relative to this directory.
80templates_path = ['_templates']
81
82# The suffix(es) of source filenames.
83# You can specify multiple suffix as a list of string:
84#
85# source_suffix = ['.rst', '.md']
86source_suffix = ['.rst', '.md']
87
88# The master toctree document.
89master_doc = 'index'
90
91# The language for content autogenerated by Sphinx. Refer to documentation
92# for a list of supported languages.
93#
94# This is also used if you do content translation via gettext catalogs.
95# Usually you set "language" from the command line for these cases.
96language = None
97
98# List of patterns, relative to source directory, that match files and
99# directories to ignore when looking for source files.
100# This pattern also affects html_static_path and html_extra_path.
101exclude_patterns = [
102 '*/LICENSE.md',
103 '*/vendor',
104 '.DS_Store',
105 'Thumbs.db',
106 '_build',
107 'doc_venv',
108 'repos',
109 'requirements.txt',
110 'bbsim/README.md',
Zack Williamsf2391542019-12-11 15:49:19 -0700111 'CODE_OF_CONDUCT.md',
112 '*/CODE_OF_CONDUCT.md',
Zack Williams071eda22019-05-15 18:19:51 -0700113]
114
115# The name of the Pygments (syntax highlighting) style to use.
116pygments_style = None
117
118# -- Options for HTML output -------------------------------------------------
119
120# The theme to use for HTML and HTML Help pages. See the documentation for
121# a list of builtin themes.
122#
123html_theme = 'sphinx_rtd_theme'
124
125# Theme options are theme-specific and customize the look and feel of a theme
126# further. For a list of options available for each theme, see the
127# documentation.
128#
129# html_theme_options = {}
130
131# Add any paths that contain custom static files (such as style sheets) here,
132# relative to this directory. They are copied after the builtin static files,
133# so a file named "default.css" will overwrite the builtin "default.css".
134html_static_path = ['_static']
135
136# Custom sidebar templates, must be a dictionary that maps document names
137# to template names.
138#
139# The default sidebars (for documents that don't match any pattern) are
140# defined by theme itself. Builtin themes are using these templates by
141# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
142# 'searchbox.html']``.
143#
144# html_sidebars = {}
145
146
147# -- Options for HTMLHelp output ---------------------------------------------
148
149# Output file base name for HTML help builder.
150htmlhelp_basename = 'VOLTHADocs'
151
152
153# -- Options for LaTeX output ------------------------------------------------
154
155latex_elements = {
156 # The paper size ('letterpaper' or 'a4paper').
157 #
158 # 'papersize': 'letterpaper',
159
160 # The font size ('10pt', '11pt' or '12pt').
161 #
162 # 'pointsize': '10pt',
163
164 # Additional stuff for the LaTeX preamble.
165 #
166 # 'preamble': '',
167
168 # Latex figure (float) alignment
169 #
170 # 'figure_align': 'htbp',
171}
172
173# Grouping the document tree into LaTeX files. List of tuples
174# (source start file, target name, title,
175# author, documentclass [howto, manual, or own class]).
176latex_documents = [
177 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
178 u'VOLTHA Team', 'manual'),
179]
180
181
182# -- Options for manual page output ------------------------------------------
183
184# One entry per manual page. List of tuples
185# (source start file, name, description, authors, manual section).
186man_pages = [
187 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
188 [author], 1)
189]
190
191
192# -- Options for Texinfo output ----------------------------------------------
193
194# Grouping the document tree into Texinfo files. List of tuples
195# (source start file, target name, title, author,
196# dir menu entry, description, category)
197texinfo_documents = [
198 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
199 author, 'VOLTHADocs', 'One line description of project.',
200 'Miscellaneous'),
201]
202
203
204# -- Options for Epub output -------------------------------------------------
205
206# Bibliographic Dublin Core info.
207epub_title = project
208
209# The unique identifier of the text. This can be a ISBN number
210# or the project homepage.
211#
212# epub_identifier = ''
213
214# A unique identification for the text.
215#
216# epub_uid = ''
217
218# A list of files that should not be packed into the epub file.
219epub_exclude_files = ['search.html']
220
221
222# -- Extension configuration -------------------------------------------------
223
224# blockdiag/etc. config
225
226rackdiag_antialias = True
227rackdiag_html_image_format = "SVG"
228rackdiag_fontpath = [
229 "_static/fonts/Inconsolata-Regular.ttf",
230 "_static/fonts/Inconsolata-Bold.ttf",
231]
232
233nwdiag_antialias = True
234nwdiag_html_image_format = "SVG"
235nwdiag_fontpath = [
236 "_static/fonts/Inconsolata-Regular.ttf",
237 "_static/fonts/Inconsolata-Bold.ttf",
238]
239
240# -- Options for todo extension ----------------------------------------------
241# If true, `todo` and `todoList` produce output, else they produce nothing.
242todo_include_todos = True
243
244# -- Configure recommonmark to use AutoStructify -----------------------------
245# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
246
247import recommonmark
248from recommonmark.transform import AutoStructify
249
250github_doc_root = 'https://github.com/opencord/voltha-docs'
251
252def setup(app):
253
254 app.add_css_file('css/rtd_theme_mods.css')
255
256 app.add_config_value('recommonmark_config', {
257 'url_resolver': lambda url: github_doc_root + url,
258 'auto_toc_tree_section': 'Contents',
259 }, True)
260
261 app.add_transform(AutoStructify)