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