blob: 5437ef2480b2bfa028ae767e31b5a90107fc6fa3 [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',
75]
76
77# Add any paths that contain templates here, relative to this directory.
78templates_path = ['_templates']
79
80# The suffix(es) of source filenames.
81# You can specify multiple suffix as a list of string:
82#
83# source_suffix = ['.rst', '.md']
84source_suffix = ['.rst', '.md']
85
86# The master toctree document.
87master_doc = 'index'
88
89# The language for content autogenerated by Sphinx. Refer to documentation
90# for a list of supported languages.
91#
92# This is also used if you do content translation via gettext catalogs.
93# Usually you set "language" from the command line for these cases.
94language = None
95
96# List of patterns, relative to source directory, that match files and
97# directories to ignore when looking for source files.
98# This pattern also affects html_static_path and html_extra_path.
99exclude_patterns = [u'_build', 'doc_venv', 'requirements.txt', 'Thumbs.db', '.DS_Store', 'repos', '*/vendor']
100
101# The name of the Pygments (syntax highlighting) style to use.
102pygments_style = None
103
Charles Chan1d337652019-09-08 12:02:27 -0700104# Ignore link check for the following websites
105linkcheck_ignore = [
Charles Chan8d63fa02019-09-17 13:25:44 -0700106 'https://www.opennetworking.org/*',
Charles Chan6613eac2019-09-17 15:42:48 -0700107 'https://opennetworking.org/*',
Charles Chan1d337652019-09-08 12:02:27 -0700108]
109
Zack Williams553a3632019-08-09 17:14:43 -0700110# -- Options for HTML output -------------------------------------------------
111
112# The theme to use for HTML and HTML Help pages. See the documentation for
113# a list of builtin themes.
114#
115html_theme = 'sphinx_rtd_theme'
116
117# Theme options are theme-specific and customize the look and feel of a theme
118# further. For a list of options available for each theme, see the
119# documentation.
120#
121# html_theme_options = {}
122
123# Add any paths that contain custom static files (such as style sheets) here,
124# relative to this directory. They are copied after the builtin static files,
125# so a file named "default.css" will overwrite the builtin "default.css".
126html_static_path = ['_static']
127
128# Custom sidebar templates, must be a dictionary that maps document names
129# to template names.
130#
131# The default sidebars (for documents that don't match any pattern) are
132# defined by theme itself. Builtin themes are using these templates by
133# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
134# 'searchbox.html']``.
135#
136# html_sidebars = {}
137
Zack Williams74429ea2019-09-13 14:16:40 -0700138# favicon
139
140html_favicon = 'images/trellis-favicon-128.png'
141
Zack Williams553a3632019-08-09 17:14:43 -0700142
143# -- Options for HTMLHelp output ---------------------------------------------
144
145# Output file base name for HTML help builder.
146htmlhelp_basename = 'TrellisDocs'
147
148
149# -- Options for LaTeX output ------------------------------------------------
150
151latex_elements = {
152 # The paper size ('letterpaper' or 'a4paper').
153 #
154 # 'papersize': 'letterpaper',
155
156 # The font size ('10pt', '11pt' or '12pt').
157 #
158 # 'pointsize': '10pt',
159
160 # Additional stuff for the LaTeX preamble.
161 #
162 # 'preamble': '',
163
164 # Latex figure (float) alignment
165 #
166 # 'figure_align': 'htbp',
167}
168
169# Grouping the document tree into LaTeX files. List of tuples
170# (source start file, target name, title,
171# author, documentclass [howto, manual, or own class]).
172latex_documents = [
173 (master_doc, 'TrellisDocs.tex', u'Trellis Docs',
174 u'Trellis Team', 'manual'),
175]
176
177
178# -- Options for manual page output ------------------------------------------
179
180# One entry per manual page. List of tuples
181# (source start file, name, description, authors, manual section).
182man_pages = [
183 (master_doc, 'Trellis Docs', u'Trellis Docs',
184 [author], 1)
185]
186
187
188# -- Options for Texinfo output ----------------------------------------------
189
190# Grouping the document tree into Texinfo files. List of tuples
191# (source start file, target name, title, author,
192# dir menu entry, description, category)
193texinfo_documents = [
194 (master_doc, 'Trellis Docs', u'Trellis Docs',
195 author, 'TrellisDocs', 'One line description of project.',
196 'Miscellaneous'),
197]
198
199
200# -- Options for Epub output -------------------------------------------------
201
202# Bibliographic Dublin Core info.
203epub_title = project
204
205# The unique identifier of the text. This can be a ISBN number
206# or the project homepage.
207#
208# epub_identifier = ''
209
210# A unique identification for the text.
211#
212# epub_uid = ''
213
214# A list of files that should not be packed into the epub file.
215epub_exclude_files = ['search.html']
216
217
218# -- Extension configuration -------------------------------------------------
219
220# blockdiag/etc. config
221
222rackdiag_antialias = True
223rackdiag_html_image_format = "SVG"
224rackdiag_fontpath = [
225 "_static/fonts/Inconsolata-Regular.ttf",
226 "_static/fonts/Inconsolata-Bold.ttf",
227]
228
229nwdiag_antialias = True
230nwdiag_html_image_format = "SVG"
231nwdiag_fontpath = [
232 "_static/fonts/Inconsolata-Regular.ttf",
233 "_static/fonts/Inconsolata-Bold.ttf",
234]
235
236# -- Options for todo extension ----------------------------------------------
237# If true, `todo` and `todoList` produce output, else they produce nothing.
238todo_include_todos = True
239
240# -- Configure recommonmark to use AutoStructify -----------------------------
241# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
242
243import recommonmark
244from recommonmark.transform import AutoStructify
245
246def setup(app):
247
248 app.add_css_file('css/rtd_theme_mods.css')
249
250 app.add_config_value('recommonmark_config', {
251 'auto_toc_tree_section': 'Contents',
252 }, True)
253
254 app.add_transform(AutoStructify)