blob: 9ea3196c8aab6b7b1e544107cfd147aa7a96adf7 [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',
111]
112
113# The name of the Pygments (syntax highlighting) style to use.
114pygments_style = None
115
116# -- Options for HTML output -------------------------------------------------
117
118# The theme to use for HTML and HTML Help pages. See the documentation for
119# a list of builtin themes.
120#
121html_theme = 'sphinx_rtd_theme'
122
123# Theme options are theme-specific and customize the look and feel of a theme
124# further. For a list of options available for each theme, see the
125# documentation.
126#
127# html_theme_options = {}
128
129# Add any paths that contain custom static files (such as style sheets) here,
130# relative to this directory. They are copied after the builtin static files,
131# so a file named "default.css" will overwrite the builtin "default.css".
132html_static_path = ['_static']
133
134# Custom sidebar templates, must be a dictionary that maps document names
135# to template names.
136#
137# The default sidebars (for documents that don't match any pattern) are
138# defined by theme itself. Builtin themes are using these templates by
139# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
140# 'searchbox.html']``.
141#
142# html_sidebars = {}
143
144
145# -- Options for HTMLHelp output ---------------------------------------------
146
147# Output file base name for HTML help builder.
148htmlhelp_basename = 'VOLTHADocs'
149
150
151# -- Options for LaTeX output ------------------------------------------------
152
153latex_elements = {
154 # The paper size ('letterpaper' or 'a4paper').
155 #
156 # 'papersize': 'letterpaper',
157
158 # The font size ('10pt', '11pt' or '12pt').
159 #
160 # 'pointsize': '10pt',
161
162 # Additional stuff for the LaTeX preamble.
163 #
164 # 'preamble': '',
165
166 # Latex figure (float) alignment
167 #
168 # 'figure_align': 'htbp',
169}
170
171# Grouping the document tree into LaTeX files. List of tuples
172# (source start file, target name, title,
173# author, documentclass [howto, manual, or own class]).
174latex_documents = [
175 (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs',
176 u'VOLTHA Team', 'manual'),
177]
178
179
180# -- Options for manual page output ------------------------------------------
181
182# One entry per manual page. List of tuples
183# (source start file, name, description, authors, manual section).
184man_pages = [
185 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
186 [author], 1)
187]
188
189
190# -- Options for Texinfo output ----------------------------------------------
191
192# Grouping the document tree into Texinfo files. List of tuples
193# (source start file, target name, title, author,
194# dir menu entry, description, category)
195texinfo_documents = [
196 (master_doc, 'VOLTHA Docs', u'VOLTHA Docs',
197 author, 'VOLTHADocs', 'One line description of project.',
198 'Miscellaneous'),
199]
200
201
202# -- Options for Epub output -------------------------------------------------
203
204# Bibliographic Dublin Core info.
205epub_title = project
206
207# The unique identifier of the text. This can be a ISBN number
208# or the project homepage.
209#
210# epub_identifier = ''
211
212# A unique identification for the text.
213#
214# epub_uid = ''
215
216# A list of files that should not be packed into the epub file.
217epub_exclude_files = ['search.html']
218
219
220# -- Extension configuration -------------------------------------------------
221
222# blockdiag/etc. config
223
224rackdiag_antialias = True
225rackdiag_html_image_format = "SVG"
226rackdiag_fontpath = [
227 "_static/fonts/Inconsolata-Regular.ttf",
228 "_static/fonts/Inconsolata-Bold.ttf",
229]
230
231nwdiag_antialias = True
232nwdiag_html_image_format = "SVG"
233nwdiag_fontpath = [
234 "_static/fonts/Inconsolata-Regular.ttf",
235 "_static/fonts/Inconsolata-Bold.ttf",
236]
237
238# -- Options for todo extension ----------------------------------------------
239# If true, `todo` and `todoList` produce output, else they produce nothing.
240todo_include_todos = True
241
242# -- Configure recommonmark to use AutoStructify -----------------------------
243# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
244
245import recommonmark
246from recommonmark.transform import AutoStructify
247
248github_doc_root = 'https://github.com/opencord/voltha-docs'
249
250def setup(app):
251
252 app.add_css_file('css/rtd_theme_mods.css')
253
254 app.add_config_value('recommonmark_config', {
255 'url_resolver': lambda url: github_doc_root + url,
256 'auto_toc_tree_section': 'Contents',
257 }, True)
258
259 app.add_transform(AutoStructify)