]>
git.proxmox.com Git - mirror_frr.git/blob - doc/developer/conf.py
1 # -*- coding: utf-8 -*-
3 # FRR documentation build configuration file, created by
4 # sphinx-quickstart on Tue Jan 31 16:00:52 2017.
6 # This file is execfile()d with the current directory set to its
9 # Note that not all possible configuration values are present in this
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
19 from sphinx
.highlighting
import lexers
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('.'))
26 # -- General configuration ------------------------------------------------
28 # If your documentation needs a minimal Sphinx version, state it here.
31 # prolog for various variable substitutions
34 # Add any Sphinx extension module names here, as strings. They can be
35 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37 extensions
= ['sphinx.ext.todo', 'sphinx.ext.graphviz']
39 # Add any paths that contain templates here, relative to this directory.
40 templates_path
= ['_templates']
42 # The suffix(es) of source filenames.
43 # You can specify multiple suffix as a list of string:
44 # source_suffix = ['.rst']
45 source_suffix
= '.rst'
47 # The encoding of source files.
48 #source_encoding = 'utf-8-sig'
50 # The master toctree document.
53 # General information about the project.
55 copyright
= u
'2017, FRR'
56 author
= u
'FRR authors'
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
62 # The short X.Y version.
64 # The full version, including alpha/beta/rc tags.
68 # -----------------------------------------------------------------------------
69 # Extract values from codebase for substitution into docs.
70 # -----------------------------------------------------------------------------
72 # Various installation prefixes. Values are extracted from config.status.
73 # Reasonable defaults are set in case that file does not exist.
76 'COPYRIGHT_YEAR': '1999-2005',
77 'COPYRIGHT_STR': 'Copyright (c) 1999-2005',
78 'PACKAGE_NAME': project
.lower(),
79 'PACKAGE_TARNAME': project
.lower(),
80 'PACKAGE_STRING': project
.lower() + ' latest',
81 'PACKAGE_URL': 'https://frrouting.org/',
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',
94 # extract version information, installation location, other stuff we need to
95 # use when building final documents
96 val
= re
.compile('^S\["([^"]+)"\]="(.*)"$')
98 with
open('../../config.status', 'r') as cfgstatus
:
99 for ln
in cfgstatus
.readlines():
101 if not m
or m
.group(1) not in replace_vars
.keys(): continue
102 replace_vars
[m
.group(1)] = m
.group(2)
104 # if config.status doesn't exist, just ignore it
107 # manually fill out some of these we can't get from config.status
108 replace_vars
['COPYRIGHT_STR'] = "Copyright (c)"
109 replace_vars
['COPYRIGHT_STR'] += ' {0}'.format(replace_vars
['COPYRIGHT_YEAR'])
110 replace_vars
['COPYRIGHT_STR'] += ' {0}'.format(replace_vars
['AUTHORS'])
111 release
= replace_vars
['PACKAGE_VERSION']
112 version
= release
.split('-')[0]
114 # add substitutions to prolog
115 for key
, value
in replace_vars
.items():
116 rst_prolog
+= '.. |{0}| replace:: {1}\n'.format(key
, value
)
119 # The language for content autogenerated by Sphinx. Refer to documentation
120 # for a list of supported languages.
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.
126 # There are two options for replacing |today|: either, you set today to some
127 # non-false value, then it is used:
129 # Else, today_fmt is used as the format for a strftime call.
130 #today_fmt = '%B %d, %Y'
132 # List of patterns, relative to source directory, that match files and
133 # directories to ignore when looking for source files.
134 exclude_patterns
= ['_build', 'building-libyang.rst', 'topotests-snippets.rst']
136 # The reST default role (used for this markup: `text`) to use for all
140 # If true, '()' will be appended to :func: etc. cross-reference text.
141 #add_function_parentheses = True
143 # If true, the current module name will be prepended to all description
144 # unit titles (such as .. function::).
145 #add_module_names = True
147 # If true, sectionauthor and moduleauthor directives will be shown in the
148 # output. They are ignored by default.
149 #show_authors = False
151 # The name of the Pygments (syntax highlighting) style to use.
152 pygments_style
= 'sphinx'
154 # A list of ignored prefixes for module index sorting.
155 #modindex_common_prefix = []
157 # If true, keep warnings as "system message" paragraphs in the built documents.
158 #keep_warnings = False
160 # If true, `todo` and `todoList` produce output, else they produce nothing.
161 todo_include_todos
= True
164 # -- Options for HTML output ----------------------------------------------
166 # The theme to use for HTML and HTML Help pages. See the documentation for
167 # a list of builtin themes.
168 html_theme
= 'default'
171 import sphinx_rtd_theme
173 html_theme
= 'sphinx_rtd_theme'
177 # Theme options are theme-specific and customize the look and feel of a theme
178 # further. For a list of options available for each theme, see the
180 #html_theme_options = {
181 # 'sidebarbgcolor': '#374249'
184 # Add any paths that contain custom themes here, relative to this directory.
185 #html_theme_path = []
187 # The name for this set of Sphinx documents. If None, it defaults to
188 # "<project> v<release> documentation".
191 # A shorter title for the navigation bar. Default is the same as html_title.
192 #html_short_title = None
194 # The name of an image file (relative to this directory) to place at the top
196 html_logo
= '../figures/frr-icon.svg'
198 # The name of an image file (within the static path) to use as favicon of the
199 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
201 html_favicon
= '../figures/frr-logo-icon.png'
203 # Add any paths that contain custom static files (such as style sheets) here,
204 # relative to this directory. They are copied after the builtin static files,
205 # so a file named "default.css" will overwrite the builtin "default.css".
206 html_static_path
= ['_static']
208 # Add any extra paths that contain custom files (such as robots.txt or
209 # .htaccess) here, relative to this directory. These files are copied
210 # directly to the root of the documentation.
211 #html_extra_path = []
213 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
214 # using the given strftime format.
215 #html_last_updated_fmt = '%b %d, %Y'
217 # If true, SmartyPants will be used to convert quotes and dashes to
218 # typographically correct entities.
219 #html_use_smartypants = True
221 # Custom sidebar templates, maps document names to template names.
224 # Additional templates that should be rendered to pages, maps page names to
226 #html_additional_pages = {}
228 # If false, no module index is generated.
229 #html_domain_indices = True
231 # If false, no index is generated.
232 #html_use_index = True
234 # If true, the index is split into individual pages for each letter.
235 #html_split_index = False
237 # If true, links to the reST sources are added to the pages.
238 #html_show_sourcelink = True
240 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
241 #html_show_sphinx = True
243 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
244 #html_show_copyright = True
246 # If true, an OpenSearch description file will be output, and all pages will
247 # contain a <link> tag referring to it. The value of this option must be the
248 # base URL from which the finished HTML is served.
249 #html_use_opensearch = ''
251 # This is the file name suffix for HTML files (e.g. ".xhtml").
252 #html_file_suffix = None
254 # Language to be used for generating the HTML full-text search index.
255 # Sphinx supports the following languages:
256 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
257 # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
258 #html_search_language = 'en'
260 # A dictionary with options for the search language support, empty by default.
261 # Now only 'ja' uses this config value
262 #html_search_options = {'type': 'default'}
264 # The name of a javascript file (relative to the configuration directory) that
265 # implements a search results scorer. If empty, the default will be used.
266 #html_search_scorer = 'scorer.js'
268 # Output file base name for HTML help builder.
269 htmlhelp_basename
= 'FRRdoc'
271 # -- Options for LaTeX output ---------------------------------------------
274 # The paper size ('letterpaper' or 'a4paper').
275 #'papersize': 'letterpaper',
277 # The font size ('10pt', '11pt' or '12pt').
278 #'pointsize': '10pt',
280 # Additional stuff for the LaTeX preamble.
283 # Latex figure (float) alignment
284 #'figure_align': 'htbp',
287 # Grouping the document tree into LaTeX files. List of tuples
288 # (source start file, target name, title,
289 # author, documentclass [howto, manual, or own class]).
291 (master_doc
, 'FRR.tex', u
"FRR Developer's Manual",
295 # The name of an image file (relative to this directory) to place at the top of
297 latex_logo
= '../figures/frr-logo-medium.png'
299 # For "manual" documents, if this is true, then toplevel headings are parts,
301 #latex_use_parts = False
303 # If true, show page references after internal links.
304 #latex_show_pagerefs = False
306 # If true, show URL addresses after external links.
307 #latex_show_urls = False
309 # Documents to append as an appendix to all manuals.
310 #latex_appendices = []
312 # If false, no module index is generated.
313 #latex_domain_indices = True
316 # -- Options for manual page output ---------------------------------------
318 # One entry per manual page. List of tuples
319 # (source start file, name, description, authors, manual section).
321 (master_doc
, 'frr', u
"FRR Developer's Manual",
325 # If true, show URL addresses after external links.
326 #man_show_urls = False
329 # -- Options for Texinfo output -------------------------------------------
331 # Grouping the document tree into Texinfo files. List of tuples
332 # (source start file, target name, title, author,
333 # dir menu entry, description, category)
334 texinfo_documents
= [
335 (master_doc
, 'frr', u
"FRR Developer's Manual",
336 author
, 'FRR', 'One line description of project.',
340 # Documents to append as an appendix to all manuals.
341 #texinfo_appendices = []
343 # If false, no module index is generated.
344 #texinfo_domain_indices = True
346 # How to display URL addresses: 'footnote', 'no', or 'inline'.
347 #texinfo_show_urls = 'footnote'
349 # If true, do not generate a @detailmenu in the "Top" node's menu.
350 #texinfo_no_detailmenu = False
352 # contents of ../extra/frrlexer.py.
353 # This is read here to support VPATH build. Since this section is execfile()'d
354 # with the file location, we can safely use a relative path here to save the
355 # contents of the lexer file for later use even if our relative path changes
357 with
open('../extra/frrlexer.py', 'rb') as lex
:
358 frrlexerpy
= lex
.read()
360 # custom extensions here
362 # object type for FRR CLI commands, can be extended to document parent CLI
364 app
.add_object_type('clicmd', 'clicmd')
365 # css overrides for HTML theme
366 app
.add_stylesheet('overrides.css')
367 # load Pygments lexer for FRR config syntax
369 # NB: in Pygments 2.2+ this can be done with `load_lexer_from_file`, but we
370 # do it manually since not all of our supported build platforms have 2.2
373 # frrlexer = pygments.lexers.load_lexer_from_file('../extra/frrlexer.py', lexername="FRRLexer")
374 custom_namespace
= {}
375 exec(frrlexerpy
, custom_namespace
)
376 lexers
['frr'] = custom_namespace
['FRRLexer']()