Charles Chan | fcfe890 | 2022-02-02 17:06:27 -0800 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org> |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | |
Zack Williams | 98fe232 | 2021-09-20 15:02:11 -0700 | [diff] [blame] | 4 | # -*- coding: utf-8 -*- |
| 5 | # |
| 6 | # Configuration file for the Sphinx documentation builder. |
| 7 | # |
| 8 | # This file does only contain a selection of the most common options. For a |
| 9 | # full list see the documentation: |
| 10 | # http://www.sphinx-doc.org/en/master/config |
| 11 | |
| 12 | # -- Path setup -------------------------------------------------------------- |
| 13 | |
| 14 | # If extensions (or modules to document with autodoc) are in another directory, |
| 15 | # add these directories to sys.path here. If the directory is relative to the |
| 16 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 17 | # |
| 18 | # import os |
| 19 | # import sys |
| 20 | # sys.path.insert(0, os.path.abspath('.')) |
| 21 | |
| 22 | import os |
| 23 | |
| 24 | def get_version(): |
| 25 | with open("VERSION") as f: |
| 26 | return f.read().strip() |
| 27 | |
| 28 | # -- Project information ----------------------------------------------------- |
| 29 | |
| 30 | project = u'SD-Fabric Docs' |
| 31 | copyright = u'2021-current, Open Networking Foundation' |
| 32 | author = u'Open Networking Foundation' |
| 33 | |
| 34 | # The short X.Y version |
| 35 | version = get_version() |
| 36 | |
| 37 | # The full version, including alpha/beta/rc tags |
| 38 | release = version |
| 39 | |
| 40 | # -- General configuration --------------------------------------------------- |
| 41 | |
| 42 | # If your documentation needs a minimal Sphinx version, state it here. |
| 43 | # |
| 44 | # needs_sphinx = '1.0' |
| 45 | |
| 46 | # make all warnings errors |
| 47 | warning_is_error = True |
| 48 | |
| 49 | # Add any Sphinx extension module names here, as strings. They can be |
| 50 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 51 | # ones. |
| 52 | extensions = [ |
| 53 | 'sphinx.ext.autosectionlabel', |
| 54 | 'sphinx.ext.coverage', |
| 55 | 'sphinx.ext.graphviz', |
| 56 | 'sphinx.ext.ifconfig', |
| 57 | 'sphinx.ext.intersphinx', |
| 58 | 'sphinx.ext.mathjax', |
| 59 | 'sphinx.ext.todo', |
| 60 | 'sphinxcontrib.spelling', |
| 61 | "sphinx_multiversion", |
| 62 | ] |
| 63 | |
| 64 | # require document prefix on section labels |
| 65 | autosectionlabel_prefix_document = True |
| 66 | |
| 67 | # Text files with lists of words that shouldn't fail the spellchecker: |
| 68 | spelling_word_list_filename=['dict.txt', ] |
| 69 | |
| 70 | # sphinx-multiversion prep, run in each versioned source directory |
| 71 | prep_commands = [ |
| 72 | ] |
| 73 | |
Daniele Moro | ed03356 | 2021-10-04 16:12:31 +0200 | [diff] [blame] | 74 | # include only the branches matching master and sdfabric-* |
Zack Williams | 98fe232 | 2021-09-20 15:02:11 -0700 | [diff] [blame] | 75 | smv_branch_whitelist = r'^(master|sdfabric-.*)$' |
| 76 | |
| 77 | # include all remote branches |
| 78 | smv_remote_whitelist = r'^.*$' |
| 79 | |
| 80 | # Add any paths that contain templates here, relative to this directory. |
| 81 | templates_path = ['_templates'] |
| 82 | |
| 83 | # The suffix(es) of source filenames. |
| 84 | # You can specify multiple suffix as a list of string: |
| 85 | # |
| 86 | # source_suffix = ['.rst', '.md'] |
| 87 | source_suffix = ['.rst'] |
| 88 | |
| 89 | # The master toctree document. |
| 90 | master_doc = 'index' |
| 91 | |
| 92 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 93 | # for a list of supported languages. |
| 94 | # |
| 95 | # This is also used if you do content translation via gettext catalogs. |
| 96 | # Usually you set "language" from the command line for these cases. |
| 97 | language = None |
| 98 | |
| 99 | # List of patterns, relative to source directory, that match files and |
| 100 | # directories to ignore when looking for source files. |
| 101 | # This pattern also affects html_static_path and html_extra_path. |
| 102 | exclude_patterns = [ |
| 103 | '*/LICENSE.md', |
| 104 | '*/vendor', |
| 105 | '.DS_Store', |
| 106 | 'Thumbs.db', |
| 107 | '_build', |
| 108 | 'venv-docs', |
| 109 | 'requirements.txt', |
| 110 | ] |
| 111 | |
| 112 | # The name of the Pygments (syntax highlighting) style to use. |
| 113 | pygments_style = None |
| 114 | |
| 115 | # -- Options for HTML output ------------------------------------------------- |
| 116 | |
| 117 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 118 | # a list of builtin themes. |
| 119 | # |
| 120 | html_theme = 'sphinx_rtd_theme' |
| 121 | |
| 122 | # html_logo = '_static/sdfabric.svg' |
| 123 | |
| 124 | html_favicon = '_static/sdfabric-favicon-128.png' |
| 125 | |
| 126 | # Theme options are theme-specific and customize the look and feel of a theme |
| 127 | # further. For a list of options available for each theme, see the |
| 128 | # documentation. |
| 129 | # |
| 130 | # html_theme_options = { |
| 131 | # 'logo_only': True |
| 132 | # } |
| 133 | |
| 134 | # Add any paths that contain custom static files (such as style sheets) here, |
| 135 | # relative to this directory. They are copied after the builtin static files, |
| 136 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 137 | html_static_path = ['_static'] |
| 138 | |
| 139 | # Custom sidebar templates, must be a dictionary that maps document names |
| 140 | # to template names. |
| 141 | # |
| 142 | # The default sidebars (for documents that don't match any pattern) are |
| 143 | # defined by theme itself. Builtin themes are using these templates by |
| 144 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 145 | # 'searchbox.html']``. |
| 146 | # |
| 147 | # html_sidebars = {} |
| 148 | |
| 149 | # -- Options for HTMLHelp output --------------------------------------------- |
| 150 | |
| 151 | # Output file base name for HTML help builder. |
| 152 | htmlhelp_basename = 'SDFabricDocs' |
| 153 | |
| 154 | |
| 155 | # -- Options for LaTeX output ------------------------------------------------ |
| 156 | |
| 157 | latex_elements = { |
| 158 | # The paper size ('letterpaper' or 'a4paper'). |
| 159 | # |
| 160 | # 'papersize': 'letterpaper', |
| 161 | |
| 162 | # The font size ('10pt', '11pt' or '12pt'). |
| 163 | # |
| 164 | # 'pointsize': '10pt', |
| 165 | |
| 166 | # Additional stuff for the LaTeX preamble. |
| 167 | # |
| 168 | # 'preamble': '', |
| 169 | |
| 170 | # Latex figure (float) alignment |
| 171 | # |
| 172 | # 'figure_align': 'htbp', |
| 173 | } |
| 174 | |
| 175 | # Grouping the document tree into LaTeX files. List of tuples |
| 176 | # (source start file, target name, title, |
| 177 | # author, documentclass [howto, manual, or own class]). |
| 178 | latex_documents = [ |
| 179 | (master_doc, 'SD-FabricDocs.tex', u'SD-Fabric Docs', |
| 180 | u'ONF', 'manual'), |
| 181 | ] |
| 182 | |
| 183 | |
| 184 | # -- Options for manual page output ------------------------------------------ |
| 185 | |
| 186 | # One entry per manual page. List of tuples |
| 187 | # (source start file, name, description, authors, manual section). |
| 188 | man_pages = [ |
| 189 | (master_doc, 'SD-Fabric Docs', u'SD-Fabric Docs', |
| 190 | [author], 1) |
| 191 | ] |
| 192 | |
| 193 | |
| 194 | # -- Options for Texinfo output ---------------------------------------------- |
| 195 | |
| 196 | # Grouping the document tree into Texinfo files. List of tuples |
| 197 | # (source start file, target name, title, author, |
| 198 | # dir menu entry, description, category) |
| 199 | texinfo_documents = [ |
| 200 | (master_doc, 'SD-Fabric Docs', u'SD-Fabric Docs', |
| 201 | author, 'SD-FabricDocs', 'One line description of project.', |
| 202 | 'Miscellaneous'), |
| 203 | ] |
| 204 | |
| 205 | |
| 206 | # -- Options for Epub output ------------------------------------------------- |
| 207 | |
| 208 | # Bibliographic Dublin Core info. |
| 209 | epub_title = project |
| 210 | |
| 211 | # The unique identifier of the text. This can be a ISBN number |
| 212 | # or the project homepage. |
| 213 | # |
| 214 | # epub_identifier = '' |
| 215 | |
| 216 | # A unique identification for the text. |
| 217 | # |
| 218 | # epub_uid = '' |
| 219 | |
| 220 | # A list of files that should not be packed into the epub file. |
| 221 | epub_exclude_files = ['search.html'] |
| 222 | |
| 223 | |
| 224 | # -- Extension configuration ------------------------------------------------- |
| 225 | |
| 226 | # blockdiag/etc. config |
| 227 | |
| 228 | rackdiag_antialias = True |
| 229 | rackdiag_html_image_format = "SVG" |
| 230 | rackdiag_fontpath = [ |
| 231 | "_static/fonts/Inconsolata-Regular.ttf", |
| 232 | "_static/fonts/Inconsolata-Bold.ttf", |
| 233 | ] |
| 234 | |
| 235 | nwdiag_antialias = True |
| 236 | nwdiag_html_image_format = "SVG" |
| 237 | nwdiag_fontpath = [ |
| 238 | "_static/fonts/Inconsolata-Regular.ttf", |
| 239 | "_static/fonts/Inconsolata-Bold.ttf", |
| 240 | ] |
| 241 | |
| 242 | # -- Options for todo extension ---------------------------------------------- |
| 243 | # If true, `todo` and `todoList` produce output, else they produce nothing. |
| 244 | todo_include_todos = True |
| 245 | |
| 246 | # -- Options for linkcheck --------------------------------------------------- |
| 247 | # The link checker strips off .md from links and then complains |
| 248 | linkcheck_ignore = [ |
Jon Hall | ced4be7 | 2021-10-04 10:19:04 -0700 | [diff] [blame] | 249 | r'https://jenkins.aetherproject.org/view/SD-Fabric%20Nightly%20Tests/' # Jenkins View, requires login |
Zack Williams | 98fe232 | 2021-09-20 15:02:11 -0700 | [diff] [blame] | 250 | ] |
| 251 | |
| 252 | linkcheck_timeout = 3 |
| 253 | linkcheck_retries = 2 |
| 254 | |
Yi Tseng | 22e7dbc | 2021-09-28 14:32:15 -0700 | [diff] [blame] | 255 | linkcheck_anchors_ignore = [ |
| 256 | r"L\d+" # Ignore line anchors from GitHub. |
| 257 | ] |
| 258 | |
Zack Williams | 98fe232 | 2021-09-20 15:02:11 -0700 | [diff] [blame] | 259 | # -- options for Intersphinx extension --------------------------------------- |
| 260 | |
| 261 | intersphinx_mapping = { |
| 262 | 'ansible': ('https://docs.ansible.com/ansible/latest', None), |
| 263 | 'sphinx': ('https://www.sphinx-doc.org/en/master', None), |
| 264 | 'trellis': ('https://docs.trellisfabric.org/master', None), |
| 265 | 'sysapproach5g': ('https://5g.systemsapproach.org/', None), |
| 266 | 'sysapproachnet': ('https://book.systemsapproach.org/', None), |
| 267 | 'sysapproachsdn': ('https://sdn.systemsapproach.org/', None), |
| 268 | } |
| 269 | |
| 270 | def setup(app): |
| 271 | |
| 272 | app.add_css_file('css/rtd_theme_mods.css') |