]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/conf.py
*: add BFD profile support for IS-IS
[mirror_frr.git] / doc / user / conf.py
CommitLineData
42fc5d26
QY
1# -*- coding: utf-8 -*-
2#
3# FRR documentation build configuration file, created by
4# sphinx-quickstart on Tue Jan 31 16:00:52 2017.
5#
6# This file is execfile()d with the current directory set to its
7# containing dir.
8#
9# Note that not all possible configuration values are present in this
10# autogenerated file.
11#
12# All configuration values have a default; values that are commented out
13# serve to show the default.
14
15import sys
16import os
17import re
d5403d4f
QY
18import pygments
19from sphinx.highlighting import lexers
42fc5d26
QY
20
21# If extensions (or modules to document with autodoc) are in another directory,
22# add these directories to sys.path here. If the directory is relative to the
23# documentation root, use os.path.abspath to make it absolute, like shown here.
24#sys.path.insert(0, os.path.abspath('.'))
25
26# -- General configuration ------------------------------------------------
27
28# If your documentation needs a minimal Sphinx version, state it here.
964b3662
QY
29needs_sphinx = '1.0'
30
31# prolog for various variable substitutions
32rst_prolog = ''
42fc5d26
QY
33
34# Add any Sphinx extension module names here, as strings. They can be
35# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
36# ones.
37extensions = ['sphinx.ext.todo']
38
39# Add any paths that contain templates here, relative to this directory.
40templates_path = ['_templates']
41
42# The suffix(es) of source filenames.
43# You can specify multiple suffix as a list of string:
964b3662 44# source_suffix = ['.rst']
42fc5d26
QY
45source_suffix = '.rst'
46
47# The encoding of source files.
48#source_encoding = 'utf-8-sig'
49
50# The master toctree document.
51master_doc = 'index'
52
53# General information about the project.
54project = u'FRR'
55copyright = u'2017, FRR'
aef62d25 56author = u'FRR authors'
42fc5d26
QY
57
58# The version info for the project you're documenting, acts as replacement for
59# |version| and |release|, also used in various other places throughout the
60# built documents.
61
62# The short X.Y version.
63version = u'?.?'
64# The full version, including alpha/beta/rc tags.
65release = u'?.?-?'
66
be46d288
QY
67
68# -----------------------------------------------------------------------------
69# Extract values from codebase for substitution into docs.
70# -----------------------------------------------------------------------------
71
aef62d25
QY
72# Various installation prefixes. Values are extracted from config.status.
73# Reasonable defaults are set in case that file does not exist.
be46d288 74replace_vars = {
aef62d25 75 'AUTHORS': author,
be46d288 76 'COPYRIGHT_YEAR': '1999-2005',
aef62d25 77 'COPYRIGHT_STR': 'Copyright (c) 1999-2005',
be46d288
QY
78 'PACKAGE_NAME': project.lower(),
79 'PACKAGE_TARNAME': project.lower(),
aef62d25 80 'PACKAGE_STRING': project.lower() + ' latest',
be46d288 81 'PACKAGE_URL': 'https://frrouting.org/',
aef62d25
QY
82 'PACKAGE_VERSION': 'latest',
83 'INSTALL_PREFIX_ETC': '/etc/frr',
84 'INSTALL_PREFIX_SBIN': '/usr/lib/frr',
85 'INSTALL_PREFIX_STATE': '/var/run/frr',
86 'INSTALL_PREFIX_MODULES': '/usr/lib/frr/modules',
87 'INSTALL_USER': 'frr',
88 'INSTALL_GROUP': 'frr',
89 'INSTALL_VTY_GROUP': 'frrvty',
90 'GROUP': 'frr',
91 'USER': 'frr',
be46d288 92}
964b3662
QY
93
94# extract version information, installation location, other stuff we need to
95# use when building final documents
42fc5d26 96val = re.compile('^S\["([^"]+)"\]="(.*)"$')
aef62d25
QY
97try:
98 with open('../../config.status', 'r') as cfgstatus:
99 for ln in cfgstatus.readlines():
100 m = val.match(ln)
101 if not m or m.group(1) not in replace_vars.keys(): continue
102 replace_vars[m.group(1)] = m.group(2)
103except IOError:
104 # if config.status doesn't exist, just ignore it
105 pass
964b3662 106
be46d288 107# manually fill out some of these we can't get from config.status
fd810097 108replace_vars['COPYRIGHT_STR'] = "Copyright (c)"
6c749456
QY
109replace_vars['COPYRIGHT_STR'] += ' {0}'.format(replace_vars['COPYRIGHT_YEAR'])
110replace_vars['COPYRIGHT_STR'] += ' {0}'.format(replace_vars['AUTHORS'])
fd810097
QY
111release = replace_vars['PACKAGE_VERSION']
112version = release.split('-')[0]
964b3662
QY
113
114# add substitutions to prolog
be46d288
QY
115for key, value in replace_vars.items():
116 rst_prolog += '.. |{0}| replace:: {1}\n'.format(key, value)
964b3662 117
42fc5d26
QY
118
119# The language for content autogenerated by Sphinx. Refer to documentation
120# for a list of supported languages.
121#
122# This is also used if you do content translation via gettext catalogs.
123# Usually you set "language" from the command line for these cases.
124language = None
125
126# There are two options for replacing |today|: either, you set today to some
127# non-false value, then it is used:
128#today = ''
129# Else, today_fmt is used as the format for a strftime call.
130#today_fmt = '%B %d, %Y'
131
132# List of patterns, relative to source directory, that match files and
133# directories to ignore when looking for source files.
00458d01 134exclude_patterns = ['_build', 'rpki.rst', 'routeserver.rst',
ed647ed2 135 'ospf_fundamentals.rst', 'flowspec.rst', 'snmptrap.rst',
136 'wecmp_linkbw.rst']
42fc5d26
QY
137
138# The reST default role (used for this markup: `text`) to use for all
139# documents.
140#default_role = None
141
142# If true, '()' will be appended to :func: etc. cross-reference text.
143#add_function_parentheses = True
144
145# If true, the current module name will be prepended to all description
146# unit titles (such as .. function::).
147#add_module_names = True
148
149# If true, sectionauthor and moduleauthor directives will be shown in the
150# output. They are ignored by default.
151#show_authors = False
152
153# The name of the Pygments (syntax highlighting) style to use.
154pygments_style = 'sphinx'
155
156# A list of ignored prefixes for module index sorting.
157#modindex_common_prefix = []
158
159# If true, keep warnings as "system message" paragraphs in the built documents.
160#keep_warnings = False
161
162# If true, `todo` and `todoList` produce output, else they produce nothing.
163todo_include_todos = True
164
165
166# -- Options for HTML output ----------------------------------------------
167
168# The theme to use for HTML and HTML Help pages. See the documentation for
169# a list of builtin themes.
37ba370b 170html_theme = 'default'
42fc5d26 171
856d02a5
DL
172try:
173 import sphinx_rtd_theme
174
175 html_theme = 'sphinx_rtd_theme'
176except ImportError:
177 pass
178
42fc5d26
QY
179# Theme options are theme-specific and customize the look and feel of a theme
180# further. For a list of options available for each theme, see the
181# documentation.
856d02a5
DL
182#html_theme_options = {
183# 'sidebarbgcolor': '#374249'
184#}
42fc5d26
QY
185
186# Add any paths that contain custom themes here, relative to this directory.
187#html_theme_path = []
188
189# The name for this set of Sphinx documents. If None, it defaults to
190# "<project> v<release> documentation".
191#html_title = None
192
193# A shorter title for the navigation bar. Default is the same as html_title.
194#html_short_title = None
195
196# The name of an image file (relative to this directory) to place at the top
197# of the sidebar.
2f8c365e 198html_logo = '../figures/frr-icon.svg'
42fc5d26
QY
199
200# The name of an image file (within the static path) to use as favicon of the
201# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
202# pixels large.
5a32c424 203html_favicon = '../figures/frr-logo-icon.png'
42fc5d26
QY
204
205# Add any paths that contain custom static files (such as style sheets) here,
206# relative to this directory. They are copied after the builtin static files,
207# so a file named "default.css" will overwrite the builtin "default.css".
4386f129 208html_static_path = ['_static']
42fc5d26
QY
209
210# Add any extra paths that contain custom files (such as robots.txt or
211# .htaccess) here, relative to this directory. These files are copied
212# directly to the root of the documentation.
213#html_extra_path = []
214
215# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
216# using the given strftime format.
217#html_last_updated_fmt = '%b %d, %Y'
218
219# If true, SmartyPants will be used to convert quotes and dashes to
220# typographically correct entities.
221#html_use_smartypants = True
222
223# Custom sidebar templates, maps document names to template names.
224#html_sidebars = {}
225
226# Additional templates that should be rendered to pages, maps page names to
227# template names.
228#html_additional_pages = {}
229
230# If false, no module index is generated.
231#html_domain_indices = True
232
233# If false, no index is generated.
234#html_use_index = True
235
236# If true, the index is split into individual pages for each letter.
237#html_split_index = False
238
239# If true, links to the reST sources are added to the pages.
240#html_show_sourcelink = True
241
242# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
243#html_show_sphinx = True
244
245# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
246#html_show_copyright = True
247
248# If true, an OpenSearch description file will be output, and all pages will
249# contain a <link> tag referring to it. The value of this option must be the
250# base URL from which the finished HTML is served.
251#html_use_opensearch = ''
252
253# This is the file name suffix for HTML files (e.g. ".xhtml").
254#html_file_suffix = None
255
256# Language to be used for generating the HTML full-text search index.
257# Sphinx supports the following languages:
258# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
259# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
260#html_search_language = 'en'
261
262# A dictionary with options for the search language support, empty by default.
263# Now only 'ja' uses this config value
264#html_search_options = {'type': 'default'}
265
266# The name of a javascript file (relative to the configuration directory) that
267# implements a search results scorer. If empty, the default will be used.
268#html_search_scorer = 'scorer.js'
269
270# Output file base name for HTML help builder.
271htmlhelp_basename = 'FRRdoc'
272
273# -- Options for LaTeX output ---------------------------------------------
274
275latex_elements = {
276# The paper size ('letterpaper' or 'a4paper').
277#'papersize': 'letterpaper',
278
279# The font size ('10pt', '11pt' or '12pt').
280#'pointsize': '10pt',
281
282# Additional stuff for the LaTeX preamble.
283#'preamble': '',
284
285# Latex figure (float) alignment
286#'figure_align': 'htbp',
287}
288
289# Grouping the document tree into LaTeX files. List of tuples
290# (source start file, target name, title,
291# author, documentclass [howto, manual, or own class]).
292latex_documents = [
293 (master_doc, 'FRR.tex', u'FRR User Manual',
294 u'FRR', 'manual'),
295]
296
297# The name of an image file (relative to this directory) to place at the top of
298# the title page.
5a32c424 299latex_logo = '../figures/frr-logo-medium.png'
42fc5d26
QY
300
301# For "manual" documents, if this is true, then toplevel headings are parts,
302# not chapters.
303#latex_use_parts = False
304
305# If true, show page references after internal links.
306#latex_show_pagerefs = False
307
308# If true, show URL addresses after external links.
309#latex_show_urls = False
310
311# Documents to append as an appendix to all manuals.
312#latex_appendices = []
313
314# If false, no module index is generated.
315#latex_domain_indices = True
316
317
318# -- Options for manual page output ---------------------------------------
319
320# One entry per manual page. List of tuples
321# (source start file, name, description, authors, manual section).
322man_pages = [
323 (master_doc, 'frr', u'FRR User Manual',
324 [author], 1)
325]
326
327# If true, show URL addresses after external links.
328#man_show_urls = False
329
330
331# -- Options for Texinfo output -------------------------------------------
332
333# Grouping the document tree into Texinfo files. List of tuples
334# (source start file, target name, title, author,
335# dir menu entry, description, category)
336texinfo_documents = [
b59555c6 337 (master_doc, 'frr', u'FRR User Manual',
42fc5d26
QY
338 author, 'FRR', 'One line description of project.',
339 'Miscellaneous'),
340]
341
342# Documents to append as an appendix to all manuals.
343#texinfo_appendices = []
344
345# If false, no module index is generated.
346#texinfo_domain_indices = True
347
348# How to display URL addresses: 'footnote', 'no', or 'inline'.
349#texinfo_show_urls = 'footnote'
350
351# If true, do not generate a @detailmenu in the "Top" node's menu.
352#texinfo_no_detailmenu = False
2731b07d 353
524ada7f
QY
354# contents of ../extra/frrlexer.py.
355# This is read here to support VPATH build. Since this section is execfile()'d
356# with the file location, we can safely use a relative path here to save the
357# contents of the lexer file for later use even if our relative path changes
358# due to VPATH.
359with open('../extra/frrlexer.py', 'rb') as lex:
360 frrlexerpy = lex.read()
361
2731b07d
QY
362# custom extensions here
363def setup(app):
364 # object type for FRR CLI commands, can be extended to document parent CLI
365 # node later on
366 app.add_object_type('clicmd', 'clicmd')
4386f129
QY
367 # css overrides for HTML theme
368 app.add_stylesheet('overrides.css')
36372632 369 app.add_javascript('overrides.js')
dff213a9
QY
370 # load Pygments lexer for FRR config syntax
371 #
372 # NB: in Pygments 2.2+ this can be done with `load_lexer_from_file`, but we
373 # do it manually since not all of our supported build platforms have 2.2
374 # yet.
375 #
376 # frrlexer = pygments.lexers.load_lexer_from_file('../extra/frrlexer.py', lexername="FRRLexer")
377 custom_namespace = {}
524ada7f 378 exec(frrlexerpy, custom_namespace)
dff213a9 379 lexers['frr'] = custom_namespace['FRRLexer']()