blob: 6dae38e97b9dd16893e214e5cedc1efbb3604fc3 [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
41project = u'Trellis Docs'
42copyright = 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 = [
106 'https://www.opennetworking.org/trellis/',
107]
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
137
138# -- Options for HTMLHelp output ---------------------------------------------
139
140# Output file base name for HTML help builder.
141htmlhelp_basename = 'TrellisDocs'
142
143
144# -- Options for LaTeX output ------------------------------------------------
145
146latex_elements = {
147 # The paper size ('letterpaper' or 'a4paper').
148 #
149 # 'papersize': 'letterpaper',
150
151 # The font size ('10pt', '11pt' or '12pt').
152 #
153 # 'pointsize': '10pt',
154
155 # Additional stuff for the LaTeX preamble.
156 #
157 # 'preamble': '',
158
159 # Latex figure (float) alignment
160 #
161 # 'figure_align': 'htbp',
162}
163
164# Grouping the document tree into LaTeX files. List of tuples
165# (source start file, target name, title,
166# author, documentclass [howto, manual, or own class]).
167latex_documents = [
168 (master_doc, 'TrellisDocs.tex', u'Trellis Docs',
169 u'Trellis Team', 'manual'),
170]
171
172
173# -- Options for manual page output ------------------------------------------
174
175# One entry per manual page. List of tuples
176# (source start file, name, description, authors, manual section).
177man_pages = [
178 (master_doc, 'Trellis Docs', u'Trellis Docs',
179 [author], 1)
180]
181
182
183# -- Options for Texinfo output ----------------------------------------------
184
185# Grouping the document tree into Texinfo files. List of tuples
186# (source start file, target name, title, author,
187# dir menu entry, description, category)
188texinfo_documents = [
189 (master_doc, 'Trellis Docs', u'Trellis Docs',
190 author, 'TrellisDocs', 'One line description of project.',
191 'Miscellaneous'),
192]
193
194
195# -- Options for Epub output -------------------------------------------------
196
197# Bibliographic Dublin Core info.
198epub_title = project
199
200# The unique identifier of the text. This can be a ISBN number
201# or the project homepage.
202#
203# epub_identifier = ''
204
205# A unique identification for the text.
206#
207# epub_uid = ''
208
209# A list of files that should not be packed into the epub file.
210epub_exclude_files = ['search.html']
211
212
213# -- Extension configuration -------------------------------------------------
214
215# blockdiag/etc. config
216
217rackdiag_antialias = True
218rackdiag_html_image_format = "SVG"
219rackdiag_fontpath = [
220 "_static/fonts/Inconsolata-Regular.ttf",
221 "_static/fonts/Inconsolata-Bold.ttf",
222]
223
224nwdiag_antialias = True
225nwdiag_html_image_format = "SVG"
226nwdiag_fontpath = [
227 "_static/fonts/Inconsolata-Regular.ttf",
228 "_static/fonts/Inconsolata-Bold.ttf",
229]
230
231# -- Options for todo extension ----------------------------------------------
232# If true, `todo` and `todoList` produce output, else they produce nothing.
233todo_include_todos = True
234
235# -- Configure recommonmark to use AutoStructify -----------------------------
236# Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html
237
238import recommonmark
239from recommonmark.transform import AutoStructify
240
241def setup(app):
242
243 app.add_css_file('css/rtd_theme_mods.css')
244
245 app.add_config_value('recommonmark_config', {
246 'auto_toc_tree_section': 'Contents',
247 }, True)
248
249 app.add_transform(AutoStructify)