Zack Williams | 3645191 | 2022-03-04 20:31:37 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | # SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 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 | |
| 29 | # -- Project information ----------------------------------------------------- |
| 30 | |
| 31 | project = u'ONF Documentation' |
| 32 | copyright = u'2020-current, Open Networking Foundation' |
| 33 | author = u'Open Networking Foundation' |
| 34 | |
| 35 | # The short X.Y version |
| 36 | version = get_version() |
| 37 | # The full version, including alpha/beta/rc tags |
| 38 | release = version |
| 39 | |
| 40 | |
| 41 | # -- General configuration --------------------------------------------------- |
| 42 | |
| 43 | # If your documentation needs a minimal Sphinx version, state it here. |
| 44 | # |
| 45 | # needs_sphinx = '1.0' |
| 46 | |
| 47 | # Add any Sphinx extension module names here, as strings. They can be |
| 48 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 49 | # ones. |
| 50 | extensions = [ |
| 51 | 'sphinx.ext.autosectionlabel', |
| 52 | 'sphinx.ext.coverage', |
| 53 | 'sphinx.ext.graphviz', |
| 54 | 'sphinx.ext.ifconfig', |
| 55 | 'sphinx.ext.intersphinx', |
| 56 | 'sphinx.ext.mathjax', |
| 57 | 'sphinx.ext.todo', |
| 58 | 'sphinxcontrib.spelling', |
| 59 | "sphinx_multiversion", |
| 60 | ] |
| 61 | |
| 62 | # require document prefix on section labels |
| 63 | autosectionlabel_prefix_document = True |
| 64 | |
| 65 | # Text files with lists of words that shouldn't fail the spellchecker: |
| 66 | spelling_word_list_filename=['dict.txt', ] |
| 67 | |
| 68 | # Add any paths that contain templates here, relative to this directory. |
| 69 | templates_path = ['_templates'] |
| 70 | |
| 71 | # The suffix(es) of source filenames. |
| 72 | # You can specify multiple suffix as a list of string: |
| 73 | # |
| 74 | # source_suffix = ['.rst', '.md'] |
| 75 | source_suffix = '.rst' |
| 76 | |
| 77 | # The master toctree document. |
| 78 | master_doc = 'index' |
| 79 | |
| 80 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 81 | # for a list of supported languages. |
| 82 | # |
| 83 | # This is also used if you do content translation via gettext catalogs. |
| 84 | # Usually you set "language" from the command line for these cases. |
| 85 | language = None |
| 86 | |
| 87 | # List of patterns, relative to source directory, that match files and |
| 88 | # directories to ignore when looking for source files. |
| 89 | # This pattern also affects html_static_path and html_extra_path. |
| 90 | exclude_patterns = [ |
| 91 | '.DS_Store', |
| 92 | 'Thumbs.db', |
| 93 | '_build', |
| 94 | 'LICENSES', |
| 95 | 'requirements.txt', |
| 96 | 'venv-docs', |
| 97 | ] |
| 98 | |
| 99 | # The name of the Pygments (syntax highlighting) style to use. |
| 100 | pygments_style = None |
| 101 | |
| 102 | |
| 103 | # -- Options for HTML output ------------------------------------------------- |
| 104 | |
| 105 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 106 | # a list of builtin themes. |
| 107 | # |
| 108 | html_theme = 'sphinx_rtd_theme' |
| 109 | |
| 110 | html_logo = '_static/onf.svg' |
| 111 | |
| 112 | html_favicon = '_static/onf-favicon-128.png' |
| 113 | |
| 114 | # Theme options are theme-specific and customize the look and feel of a theme |
| 115 | # further. For a list of options available for each theme, see the |
| 116 | # documentation. |
| 117 | |
| 118 | html_theme_options = { |
| 119 | 'logo_only': True |
| 120 | } |
| 121 | # Add any paths that contain custom static files (such as style sheets) here, |
| 122 | # relative to this directory. They are copied after the builtin static files, |
| 123 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 124 | html_static_path = ['_static'] |
| 125 | |
| 126 | # Custom sidebar templates, must be a dictionary that maps document names |
| 127 | # to template names. |
| 128 | # |
| 129 | # The default sidebars (for documents that don't match any pattern) are |
| 130 | # defined by theme itself. Builtin themes are using these templates by |
| 131 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 132 | # 'searchbox.html']``. |
| 133 | # |
| 134 | # html_sidebars = {} |
| 135 | |
| 136 | |
| 137 | # -- Options for HTMLHelp output --------------------------------------------- |
| 138 | |
| 139 | # Output file base name for HTML help builder. |
| 140 | htmlhelp_basename = 'ONFDocs' |
| 141 | |
| 142 | |
| 143 | # -- Options for LaTeX output ------------------------------------------------ |
| 144 | |
| 145 | # latex_engine = "xelatex" |
| 146 | |
| 147 | latex_elements = { |
| 148 | # The paper size ('letterpaper' or 'a4paper'). |
| 149 | # |
| 150 | # 'papersize': 'letterpaper', |
| 151 | |
| 152 | # The font size ('10pt', '11pt' or '12pt'). |
| 153 | # |
| 154 | # 'pointsize': '10pt', |
| 155 | |
| 156 | # Additional stuff for the LaTeX preamble. |
| 157 | # |
| 158 | # 'preamble': '', |
| 159 | |
| 160 | # Latex figure (float) alignment |
| 161 | # |
| 162 | # 'figure_align': 'htbp', |
| 163 | } |
| 164 | |
| 165 | # Grouping the document tree into LaTeX files. List of tuples |
| 166 | # (source start file, target name, title, |
| 167 | # author, documentclass [howto, manual, or own class]). |
| 168 | latex_documents = [ |
| 169 | (master_doc, 'ONFDocs.tex', u'ONF Docs', |
| 170 | u'ONF Team', 'manual'), |
| 171 | ] |
| 172 | |
| 173 | |
| 174 | # -- Options for manual page output ------------------------------------------ |
| 175 | |
| 176 | # One entry per manual page. List of tuples |
| 177 | # (source start file, name, description, authors, manual section). |
| 178 | man_pages = [ |
| 179 | (master_doc, 'onfdocs', u'ONF Docs', |
| 180 | [author], 1) |
| 181 | ] |
| 182 | |
| 183 | |
| 184 | # -- Options for Texinfo output ---------------------------------------------- |
| 185 | |
| 186 | # Grouping the document tree into Texinfo files. List of tuples |
| 187 | # (source start file, target name, title, author, |
| 188 | # dir menu entry, description, category) |
| 189 | texinfo_documents = [ |
| 190 | (master_doc, 'ONFDocs', u'ONF Docs', |
| 191 | author, 'ONFDocs', 'ONF Documentation', |
| 192 | 'Miscellaneous'), |
| 193 | ] |
| 194 | |
| 195 | |
| 196 | # -- Options for Epub output ------------------------------------------------- |
| 197 | |
| 198 | # Bibliographic Dublin Core info. |
| 199 | epub_title = project |
| 200 | |
| 201 | # The unique identifier of the text. This can be a ISBN number |
| 202 | # or the project homepage. |
| 203 | # |
| 204 | # epub_identifier = '' |
| 205 | |
| 206 | # A unique identification for the text. |
| 207 | # |
| 208 | # epub_uid = '' |
| 209 | |
| 210 | # A list of files that should not be packed into the epub file. |
| 211 | epub_exclude_files = ['search.html'] |
| 212 | |
| 213 | |
| 214 | # -- Options for todo extension ---------------------------------------------- |
| 215 | # If true, `todo` and `todoList` produce output, else they produce nothing. |
| 216 | todo_include_todos = True |
| 217 | |
| 218 | # -- Options for linkcheck --------------------------------------------------- |
| 219 | # The link checker strips off .md from links and then complains |
| 220 | linkcheck_ignore = [ |
| 221 | r'https://gerrit.opencord.org/settings/.*', |
| 222 | ] |
| 223 | |
| 224 | # -- options for Intersphinx extension --------------------------------------- |
| 225 | |
| 226 | intersphinx_mapping = { |
| 227 | 'ansible': ('https://docs.ansible.com/ansible/latest', None), |
| 228 | 'sphinx': ('https://www.sphinx-doc.org/en/master', None), |
| 229 | 'rtd': ('https://docs.readthedocs.io/en/stable', None), |
| 230 | 'trellis': ('https://docs.trellisfabric.org/master', None), |
| 231 | 'voltha': ('https://docs.voltha.org/master', None), |
| 232 | 'aether': ('https://docs.aetherproject.org/master', None), |
| 233 | 'sdcore': ('https://docs.sd-core.opennetworking.org/master', None), |
| 234 | 'sdran': ('https://docs.sd-ran.org/master', None), |
| 235 | 'sdran': ('https://docs.sd-fabric.org/master', None), |
| 236 | 'sysapproach5g': ('https://5g.systemsapproach.org/', None), |
| 237 | 'sysapproachnet': ('https://book.systemsapproach.org/', None), |
| 238 | 'sysapproachsdn': ('https://sdn.systemsapproach.org/', None), |
| 239 | 'sysapproachops': ('https://ops.systemsapproach.org/', None), |
| 240 | } |
| 241 | |
| 242 | def setup(app): |
| 243 | |
| 244 | app.add_css_file('css/rtd_theme_mods.css') |
| 245 | |