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