blob: 8692aca2f63132c97a69d00f71dd8cbef25c83b6 [file] [log] [blame]
Zack Williams553a3632019-08-09 17:14:43 -07001# Copyright 2019-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# -*- coding: utf-8 -*-
16#
17# Configuration file for the Sphinx documentation builder.
18#
19# This file does only contain a selection of the most common options. For a
20# full list see the documentation:
21# http://www.sphinx-doc.org/en/master/config
22
23# -- Path setup --------------------------------------------------------------
24
25# If extensions (or modules to document with autodoc) are in another directory,
26# add these directories to sys.path here. If the directory is relative to the
27# documentation root, use os.path.abspath to make it absolute, like shown here.
28#
29# import os
30# import sys
31# sys.path.insert(0, os.path.abspath('.'))
32
33import os
34
35def get_version():
36 with open("VERSION") as f:
37 return f.read().strip()
38
39# -- Project information -----------------------------------------------------
40
Charles Chan369aa052019-09-11 16:59:04 -070041project = u'Trellis'
Zack Williams553a3632019-08-09 17:14:43 -070042copyright = u'2019, Open Networking Foundation'
43author = u'Trellis Community'
44
45# The short X.Y version
46version = get_version()
47
48# The full version, including alpha/beta/rc tags
49release = get_version()
50
51# -- General configuration ---------------------------------------------------
52
53# If your documentation needs a minimal Sphinx version, state it here.
54#
55# needs_sphinx = '1.0'
56
57# make all warnings errors
58warning_is_error = True
59
60# Add any Sphinx extension module names here, as strings. They can be
61# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
62# ones.
63extensions = [
64 'recommonmark',
65 'sphinx.ext.coverage',
66 'sphinx.ext.ifconfig',
67 'sphinx.ext.mathjax',
68 'sphinx.ext.todo',
69 'sphinxcontrib.actdiag',
70 'sphinxcontrib.blockdiag',
71 'sphinxcontrib.nwdiag',
72 'sphinxcontrib.packetdiag',
73 'sphinxcontrib.rackdiag',
74 'sphinxcontrib.seqdiag',
Zack Williamsd63d35b2020-06-23 14:12:46 -070075 'sphinxcontrib.spelling',
76 'sphinx_multiversion',
Zack Williams553a3632019-08-09 17:14:43 -070077]
78
79# Add any paths that contain templates here, relative to this directory.
80templates_path = ['_templates']
81
Zack Williamsd63d35b2020-06-23 14:12:46 -070082# Text files with lists of words that shouldn't fail the spellchecker:
83spelling_word_list_filename=['dict.txt', ]
84
85# inlcude only the branches matching master and 1.x
86smv_branch_whitelist = r'^(master|1.*)$'
87
88# include all remote branches
89smv_remote_whitelist = r'^.*$'
90
Zack Williams553a3632019-08-09 17:14:43 -070091# The suffix(es) of source filenames.
92# You can specify multiple suffix as a list of string:
93#
94# source_suffix = ['.rst', '.md']
95source_suffix = ['.rst', '.md']
96
97# The master toctree document.
98master_doc = 'index'
99
100# The language for content autogenerated by Sphinx. Refer to documentation
101# for a list of supported languages.
102#
103# This is also used if you do content translation via gettext catalogs.
104# Usually you set "language" from the command line for these cases.
105language = None
106
107# List of patterns, relative to source directory, that match files and
108# directories to ignore when looking for source files.
109# This pattern also affects html_static_path and html_extra_path.
110exclude_patterns = [u'_build', 'doc_venv', 'requirements.txt', 'Thumbs.db', '.DS_Store', 'repos', '*/vendor']
111
112# The name of the Pygments (syntax highlighting) style to use.
113pygments_style = None
114
Charles Chan1d337652019-09-08 12:02:27 -0700115# Ignore link check for the following websites
116linkcheck_ignore = [
Charles Chan8d63fa02019-09-17 13:25:44 -0700117 'https://www.opennetworking.org/*',
Charles Chan6613eac2019-09-17 15:42:48 -0700118 'https://opennetworking.org/*',
Charles Chan1d337652019-09-08 12:02:27 -0700119]
120
Zack Williams553a3632019-08-09 17:14:43 -0700121# -- Options for HTML output -------------------------------------------------
122
123# The theme to use for HTML and HTML Help pages. See the documentation for
124# a list of builtin themes.
125#
126html_theme = 'sphinx_rtd_theme'
127
128# Theme options are theme-specific and customize the look and feel of a theme
129# further. For a list of options available for each theme, see the
130# documentation.
131#
132# html_theme_options = {}
133
134# Add any paths that contain custom static files (such as style sheets) here,
135# relative to this directory. They are copied after the builtin static files,
136# so a file named "default.css" will overwrite the builtin "default.css".
137html_static_path = ['_static']
138
139# Custom sidebar templates, must be a dictionary that maps document names
140# to template names.
141#
142# The default sidebars (for documents that don't match any pattern) are
143# defined by theme itself. Builtin themes are using these templates by
144# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
145# 'searchbox.html']``.
146#
147# html_sidebars = {}
148
Zack Williams74429ea2019-09-13 14:16:40 -0700149# favicon
150
151html_favicon = 'images/trellis-favicon-128.png'
152
Zack Williams553a3632019-08-09 17:14:43 -0700153
154# -- Options for HTMLHelp output ---------------------------------------------
155
156# Output file base name for HTML help builder.
157htmlhelp_basename = 'TrellisDocs'
158
159
160# -- Options for LaTeX output ------------------------------------------------
161
162latex_elements = {
163 # The paper size ('letterpaper' or 'a4paper').
164 #
165 # 'papersize': 'letterpaper',
166
167 # The font size ('10pt', '11pt' or '12pt').
168 #
169 # 'pointsize': '10pt',
170
171 # Additional stuff for the LaTeX preamble.
172 #
173 # 'preamble': '',
174
175 # Latex figure (float) alignment
176 #
177 # 'figure_align': 'htbp',
178}
179
180# Grouping the document tree into LaTeX files. List of tuples
181# (source start file, target name, title,
182# author, documentclass [howto, manual, or own class]).
183latex_documents = [
184 (master_doc, 'TrellisDocs.tex', u'Trellis Docs',
185 u'Trellis Team', 'manual'),
186]
187
188
189# -- Options for manual page output ------------------------------------------
190
191# One entry per manual page. List of tuples
192# (source start file, name, description, authors, manual section).
193man_pages = [
194 (master_doc, 'Trellis Docs', u'Trellis Docs',
195 [author], 1)
196]
197
198
199# -- Options for Texinfo output ----------------------------------------------
200
201# Grouping the document tree into Texinfo files. List of tuples
202# (source start file, target name, title, author,
203# dir menu entry, description, category)
204texinfo_documents = [
205 (master_doc, 'Trellis Docs', u'Trellis Docs',
206 author, 'TrellisDocs', 'One line description of project.',
207 'Miscellaneous'),
208]
209
210
211# -- Options for Epub output -------------------------------------------------
212
213# Bibliographic Dublin Core info.
214epub_title = project
215
216# The unique identifier of the text. This can be a ISBN number
217# or the project homepage.
218#
219# epub_identifier = ''
220
221# A unique identification for the text.
222#
223# epub_uid = ''
224
225# A list of files that should not be packed into the epub file.
226epub_exclude_files = ['search.html']
227
228
229# -- Extension configuration -------------------------------------------------
230
231# blockdiag/etc. config
232
233rackdiag_antialias = True
234rackdiag_html_image_format = "SVG"
235rackdiag_fontpath = [
236 "_static/fonts/Inconsolata-Regular.ttf",
237 "_static/fonts/Inconsolata-Bold.ttf",
238]
239
240nwdiag_antialias = True
241nwdiag_html_image_format = "SVG"
242nwdiag_fontpath = [
243 "_static/fonts/Inconsolata-Regular.ttf",
244 "_static/fonts/Inconsolata-Bold.ttf",
245]
246
247# -- Options for todo extension ----------------------------------------------
248# If true, `todo` and `todoList` produce output, else they produce nothing.
249todo_include_todos = True
250
251# -- Configure recommonmark to use AutoStructify -----------------------------
252# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
253
254import recommonmark
255from recommonmark.transform import AutoStructify
256
257def setup(app):
258
259 app.add_css_file('css/rtd_theme_mods.css')
260
261 app.add_config_value('recommonmark_config', {
262 'auto_toc_tree_section': 'Contents',
263 }, True)
264
265 app.add_transform(AutoStructify)