blob: a124a7b82640a51dcb44de5b019d5a72fa13817f [file] [log] [blame]
Charles Chanfcfe8902022-02-02 17:06:27 -08001# SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
2# SPDX-License-Identifier: Apache-2.0
3
Zack Williams98fe2322021-09-20 15:02:11 -07004# -*- coding: utf-8 -*-
5#
6# Configuration file for the Sphinx documentation builder.
7#
8# This file does only contain a selection of the most common options. For a
9# full list see the documentation:
10# http://www.sphinx-doc.org/en/master/config
11
12# -- Path setup --------------------------------------------------------------
13
14# If extensions (or modules to document with autodoc) are in another directory,
15# add these directories to sys.path here. If the directory is relative to the
16# documentation root, use os.path.abspath to make it absolute, like shown here.
17#
18# import os
19# import sys
20# sys.path.insert(0, os.path.abspath('.'))
21
22import os
23
24def get_version():
25 with open("VERSION") as f:
26 return f.read().strip()
27
28# -- Project information -----------------------------------------------------
29
30project = u'SD-Fabric Docs'
31copyright = u'2021-current, Open Networking Foundation'
32author = u'Open Networking Foundation'
33
34# The short X.Y version
35version = get_version()
36
37# The full version, including alpha/beta/rc tags
38release = version
39
40# -- General configuration ---------------------------------------------------
41
42# If your documentation needs a minimal Sphinx version, state it here.
43#
44# needs_sphinx = '1.0'
45
46# make all warnings errors
47warning_is_error = True
48
49# Add any Sphinx extension module names here, as strings. They can be
50# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
51# ones.
52extensions = [
53 'sphinx.ext.autosectionlabel',
54 'sphinx.ext.coverage',
55 'sphinx.ext.graphviz',
56 'sphinx.ext.ifconfig',
57 'sphinx.ext.intersphinx',
58 'sphinx.ext.mathjax',
59 'sphinx.ext.todo',
60 'sphinxcontrib.spelling',
61 "sphinx_multiversion",
62]
63
64# require document prefix on section labels
65autosectionlabel_prefix_document = True
66
67# Text files with lists of words that shouldn't fail the spellchecker:
68spelling_word_list_filename=['dict.txt', ]
69
70# sphinx-multiversion prep, run in each versioned source directory
71prep_commands = [
72]
73
Daniele Moroed033562021-10-04 16:12:31 +020074# include only the branches matching master and sdfabric-*
Zack Williams98fe2322021-09-20 15:02:11 -070075smv_branch_whitelist = r'^(master|sdfabric-.*)$'
76
77# include all remote branches
78smv_remote_whitelist = r'^.*$'
79
80# Add any paths that contain templates here, relative to this directory.
81templates_path = ['_templates']
82
83# The suffix(es) of source filenames.
84# You can specify multiple suffix as a list of string:
85#
86# source_suffix = ['.rst', '.md']
87source_suffix = ['.rst']
88
89# The master toctree document.
90master_doc = 'index'
91
92# The language for content autogenerated by Sphinx. Refer to documentation
93# for a list of supported languages.
94#
95# This is also used if you do content translation via gettext catalogs.
96# Usually you set "language" from the command line for these cases.
97language = None
98
99# List of patterns, relative to source directory, that match files and
100# directories to ignore when looking for source files.
101# This pattern also affects html_static_path and html_extra_path.
102exclude_patterns = [
Zack Williams98fe2322021-09-20 15:02:11 -0700103 '.DS_Store',
Zack Williamse100ab52022-03-05 09:07:57 -0700104 'LICENSE',
105 'README',
Zack Williams98fe2322021-09-20 15:02:11 -0700106 'Thumbs.db',
107 '_build',
Zack Williams98fe2322021-09-20 15:02:11 -0700108 'requirements.txt',
Zack Williamse100ab52022-03-05 09:07:57 -0700109 'venv-docs',
Zack Williams98fe2322021-09-20 15:02:11 -0700110]
111
112# The name of the Pygments (syntax highlighting) style to use.
113pygments_style = None
114
115# -- Options for HTML output -------------------------------------------------
116
117# The theme to use for HTML and HTML Help pages. See the documentation for
118# a list of builtin themes.
119#
120html_theme = 'sphinx_rtd_theme'
121
Zack Williamse100ab52022-03-05 09:07:57 -0700122html_logo = '_static/sdfabric-logo.svg'
Zack Williams98fe2322021-09-20 15:02:11 -0700123
124html_favicon = '_static/sdfabric-favicon-128.png'
125
Zack Williamse100ab52022-03-05 09:07:57 -0700126html_theme_options = {
127 'logo_only': True
128}
Zack Williams98fe2322021-09-20 15:02:11 -0700129
130# Add any paths that contain custom static files (such as style sheets) here,
131# relative to this directory. They are copied after the builtin static files,
132# so a file named "default.css" will overwrite the builtin "default.css".
133html_static_path = ['_static']
134
135# Custom sidebar templates, must be a dictionary that maps document names
136# to template names.
137#
138# The default sidebars (for documents that don't match any pattern) are
139# defined by theme itself. Builtin themes are using these templates by
140# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
141# 'searchbox.html']``.
142#
143# html_sidebars = {}
144
145# -- Options for HTMLHelp output ---------------------------------------------
146
147# Output file base name for HTML help builder.
148htmlhelp_basename = 'SDFabricDocs'
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, 'SD-FabricDocs.tex', u'SD-Fabric Docs',
176 u'ONF', '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, 'SD-Fabric Docs', u'SD-Fabric 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, 'SD-Fabric Docs', u'SD-Fabric Docs',
197 author, 'SD-FabricDocs', '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# -- Options for linkcheck ---------------------------------------------------
243# The link checker strips off .md from links and then complains
244linkcheck_ignore = [
Jon Hallced4be72021-10-04 10:19:04 -0700245 r'https://jenkins.aetherproject.org/view/SD-Fabric%20Nightly%20Tests/' # Jenkins View, requires login
Zack Williams98fe2322021-09-20 15:02:11 -0700246]
247
248linkcheck_timeout = 3
249linkcheck_retries = 2
250
Yi Tseng22e7dbc2021-09-28 14:32:15 -0700251linkcheck_anchors_ignore = [
252 r"L\d+" # Ignore line anchors from GitHub.
253]
254
Zack Williams98fe2322021-09-20 15:02:11 -0700255# -- options for Intersphinx extension ---------------------------------------
256
257intersphinx_mapping = {
Zack Williams98fe2322021-09-20 15:02:11 -0700258 'trellis': ('https://docs.trellisfabric.org/master', None),
Zack Williamse100ab52022-03-05 09:07:57 -0700259 'aether': ('https://docs.aetherproject.org/master', None),
260 'onf': ('https://docs.opennetworking.org/', None),
Zack Williams98fe2322021-09-20 15:02:11 -0700261 'sysapproach5g': ('https://5g.systemsapproach.org/', None),
262 'sysapproachnet': ('https://book.systemsapproach.org/', None),
263 'sysapproachsdn': ('https://sdn.systemsapproach.org/', None),
Charles Chanb7323682022-03-02 12:33:15 -0800264}
Zack Williams98fe2322021-09-20 15:02:11 -0700265
266def setup(app):
267
268 app.add_css_file('css/rtd_theme_mods.css')