Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # |
| 3 | # Configuration file for the Sphinx documentation builder. |
| 4 | # |
| 5 | # This file does only contain a selection of the most common options. For a |
| 6 | # full list see the documentation: |
| 7 | # http://www.sphinx-doc.org/en/master/config |
| 8 | |
| 9 | # -- Path setup -------------------------------------------------------------- |
| 10 | |
| 11 | # If extensions (or modules to document with autodoc) are in another directory, |
| 12 | # add these directories to sys.path here. If the directory is relative to the |
| 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 14 | # |
| 15 | # import os |
| 16 | # import sys |
| 17 | # sys.path.insert(0, os.path.abspath('.')) |
| 18 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 19 | import os |
| 20 | |
| 21 | def get_version(): |
| 22 | with open("VERSION") as f: |
| 23 | return f.read().strip() |
| 24 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 25 | # -- Project information ----------------------------------------------------- |
| 26 | |
| 27 | project = u'VOLTHA Docs' |
Zack Williams | 6b2fcf2 | 2021-09-14 06:50:44 -0700 | [diff] [blame] | 28 | copyright = u'2019-2021, VOLTHA Contributors & Open Networking Foundation' |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 29 | author = u'VOLTHA Contributors' |
| 30 | |
| 31 | # The short X.Y version |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 32 | version = get_version() |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 33 | |
| 34 | # The full version, including alpha/beta/rc tags |
Zack Williams | 88df474 | 2019-12-20 08:24:47 -0700 | [diff] [blame] | 35 | release = version |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 36 | |
| 37 | # -- General configuration --------------------------------------------------- |
| 38 | |
| 39 | # If your documentation needs a minimal Sphinx version, state it here. |
| 40 | # |
| 41 | # needs_sphinx = '1.0' |
| 42 | |
| 43 | # make all warnings errors |
| 44 | warning_is_error = True |
| 45 | |
| 46 | # Add any Sphinx extension module names here, as strings. They can be |
| 47 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 48 | # ones. |
| 49 | extensions = [ |
| 50 | 'recommonmark', |
| 51 | 'sphinx.ext.coverage', |
| 52 | 'sphinx.ext.graphviz', |
| 53 | 'sphinx.ext.ifconfig', |
| 54 | 'sphinx.ext.mathjax', |
| 55 | 'sphinx.ext.todo', |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 56 | 'sphinxcontrib.spelling', |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 57 | "sphinx_multiversion", |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 58 | "sphinx.ext.intersphinx", |
Andrea Campanella | c18d118 | 2021-09-10 12:01:38 +0200 | [diff] [blame] | 59 | "sphinxcontrib.openapi", |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 60 | ] |
| 61 | |
| 62 | # API documentation |
| 63 | # https://github.com/rtfd/sphinx-autoapi |
| 64 | # https://sphinx-autoapi.readthedocs.io |
| 65 | # autoapi_type = 'go' |
| 66 | # autoapi_dirs = [ |
| 67 | # 'voltha-go/cli/util', |
| 68 | # 'voltha-go/rw_core/config', |
| 69 | # 'voltha-go/rw_core/core', |
| 70 | # 'voltha-go/rw_core/graph', |
| 71 | # 'voltha-go/rw_core/utils', |
| 72 | # ] |
| 73 | |
Zack Williams | c6460c2 | 2019-12-18 14:54:43 -0700 | [diff] [blame] | 74 | # Text files with lists of words that shouldn't fail the spellchecker: |
| 75 | spelling_word_list_filename=['dict.txt', ] |
| 76 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 77 | # sphinx-multiversion prep, run in each versioned source directory |
| 78 | prep_commands = [ |
Zack Williams | 88df474 | 2019-12-20 08:24:47 -0700 | [diff] [blame] | 79 | 'ln -sf _root_/repos _target_/repos', |
| 80 | 'make prep', |
| 81 | ] |
| 82 | |
Zack Williams | 6b2fcf2 | 2021-09-14 06:50:44 -0700 | [diff] [blame] | 83 | # don't include tags |
| 84 | smv_tag_whitelist = None |
| 85 | |
Zack Williams | 7674432 | 2020-04-09 22:00:35 -0700 | [diff] [blame] | 86 | # inlcude only the branches matching master and voltha-* |
| 87 | smv_branch_whitelist = r'^(master|voltha-.*)$' |
| 88 | |
| 89 | # include all remote branches |
| 90 | smv_remote_whitelist = r'^.*$' |
| 91 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 92 | # Add any paths that contain templates here, relative to this directory. |
| 93 | templates_path = ['_templates'] |
| 94 | |
| 95 | # The suffix(es) of source filenames. |
| 96 | # You can specify multiple suffix as a list of string: |
| 97 | # |
| 98 | # source_suffix = ['.rst', '.md'] |
| 99 | source_suffix = ['.rst', '.md'] |
| 100 | |
| 101 | # The master toctree document. |
| 102 | master_doc = 'index' |
| 103 | |
| 104 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 105 | # for a list of supported languages. |
| 106 | # |
| 107 | # This is also used if you do content translation via gettext catalogs. |
| 108 | # Usually you set "language" from the command line for these cases. |
| 109 | language = None |
| 110 | |
| 111 | # List of patterns, relative to source directory, that match files and |
| 112 | # directories to ignore when looking for source files. |
| 113 | # This pattern also affects html_static_path and html_extra_path. |
| 114 | exclude_patterns = [ |
| 115 | '*/LICENSE.md', |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 116 | '*/RELEASE_NOTES.md', |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 117 | '*/vendor', |
| 118 | '.DS_Store', |
| 119 | 'Thumbs.db', |
| 120 | '_build', |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 121 | 'venv_docs', |
Andrea Campanella | 92bd59b | 2020-01-30 17:26:32 +0100 | [diff] [blame] | 122 | 'voltha-system-tests/vst_venv', |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 123 | 'voltha-go/BUILD.md', |
Andy Bavier | 39d67b1 | 2020-02-27 16:08:52 -0700 | [diff] [blame] | 124 | 'cord-tester/venv_cord', |
| 125 | 'cord-tester/docs', |
| 126 | 'cord-tester/src', |
| 127 | 'cord-tester/README.md', |
| 128 | 'cord-tester/cord-robot/README.rst', |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 129 | 'openolt/agent/*', |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 130 | 'repos', |
| 131 | 'requirements.txt', |
| 132 | 'bbsim/README.md', |
Zack Williams | f239154 | 2019-12-11 15:49:19 -0700 | [diff] [blame] | 133 | 'CODE_OF_CONDUCT.md', |
| 134 | '*/CODE_OF_CONDUCT.md', |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 135 | 'doc_venv/*' |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 136 | ] |
| 137 | |
| 138 | # The name of the Pygments (syntax highlighting) style to use. |
| 139 | pygments_style = None |
| 140 | |
| 141 | # -- Options for HTML output ------------------------------------------------- |
| 142 | |
| 143 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 144 | # a list of builtin themes. |
| 145 | # |
| 146 | html_theme = 'sphinx_rtd_theme' |
| 147 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 148 | html_logo = '_static/voltha.svg' |
| 149 | |
| 150 | html_favicon = '_static/voltha-favicon-128.png' |
| 151 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 152 | # Theme options are theme-specific and customize the look and feel of a theme |
| 153 | # further. For a list of options available for each theme, see the |
| 154 | # documentation. |
| 155 | # |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 156 | html_theme_options = { |
| 157 | 'logo_only': True |
| 158 | } |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 159 | |
| 160 | # Add any paths that contain custom static files (such as style sheets) here, |
| 161 | # relative to this directory. They are copied after the builtin static files, |
| 162 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 163 | html_static_path = ['_static'] |
| 164 | |
| 165 | # Custom sidebar templates, must be a dictionary that maps document names |
| 166 | # to template names. |
| 167 | # |
| 168 | # The default sidebars (for documents that don't match any pattern) are |
| 169 | # defined by theme itself. Builtin themes are using these templates by |
| 170 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 171 | # 'searchbox.html']``. |
| 172 | # |
| 173 | # html_sidebars = {} |
| 174 | |
| 175 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 176 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 177 | # -- Options for HTMLHelp output --------------------------------------------- |
| 178 | |
| 179 | # Output file base name for HTML help builder. |
| 180 | htmlhelp_basename = 'VOLTHADocs' |
| 181 | |
| 182 | |
| 183 | # -- Options for LaTeX output ------------------------------------------------ |
| 184 | |
| 185 | latex_elements = { |
| 186 | # The paper size ('letterpaper' or 'a4paper'). |
| 187 | # |
| 188 | # 'papersize': 'letterpaper', |
| 189 | |
| 190 | # The font size ('10pt', '11pt' or '12pt'). |
| 191 | # |
| 192 | # 'pointsize': '10pt', |
| 193 | |
| 194 | # Additional stuff for the LaTeX preamble. |
| 195 | # |
| 196 | # 'preamble': '', |
| 197 | |
| 198 | # Latex figure (float) alignment |
| 199 | # |
| 200 | # 'figure_align': 'htbp', |
| 201 | } |
| 202 | |
| 203 | # Grouping the document tree into LaTeX files. List of tuples |
| 204 | # (source start file, target name, title, |
| 205 | # author, documentclass [howto, manual, or own class]). |
| 206 | latex_documents = [ |
| 207 | (master_doc, 'VOLTHADocs.tex', u'VOLTHA Docs', |
| 208 | u'VOLTHA Team', 'manual'), |
| 209 | ] |
| 210 | |
| 211 | |
| 212 | # -- Options for manual page output ------------------------------------------ |
| 213 | |
| 214 | # One entry per manual page. List of tuples |
| 215 | # (source start file, name, description, authors, manual section). |
| 216 | man_pages = [ |
| 217 | (master_doc, 'VOLTHA Docs', u'VOLTHA Docs', |
| 218 | [author], 1) |
| 219 | ] |
| 220 | |
| 221 | |
| 222 | # -- Options for Texinfo output ---------------------------------------------- |
| 223 | |
| 224 | # Grouping the document tree into Texinfo files. List of tuples |
| 225 | # (source start file, target name, title, author, |
| 226 | # dir menu entry, description, category) |
| 227 | texinfo_documents = [ |
| 228 | (master_doc, 'VOLTHA Docs', u'VOLTHA Docs', |
| 229 | author, 'VOLTHADocs', 'One line description of project.', |
| 230 | 'Miscellaneous'), |
| 231 | ] |
| 232 | |
| 233 | |
| 234 | # -- Options for Epub output ------------------------------------------------- |
| 235 | |
| 236 | # Bibliographic Dublin Core info. |
| 237 | epub_title = project |
| 238 | |
| 239 | # The unique identifier of the text. This can be a ISBN number |
| 240 | # or the project homepage. |
| 241 | # |
| 242 | # epub_identifier = '' |
| 243 | |
| 244 | # A unique identification for the text. |
| 245 | # |
| 246 | # epub_uid = '' |
| 247 | |
| 248 | # A list of files that should not be packed into the epub file. |
| 249 | epub_exclude_files = ['search.html'] |
| 250 | |
| 251 | |
| 252 | # -- Extension configuration ------------------------------------------------- |
| 253 | |
| 254 | # blockdiag/etc. config |
| 255 | |
| 256 | rackdiag_antialias = True |
| 257 | rackdiag_html_image_format = "SVG" |
| 258 | rackdiag_fontpath = [ |
| 259 | "_static/fonts/Inconsolata-Regular.ttf", |
| 260 | "_static/fonts/Inconsolata-Bold.ttf", |
| 261 | ] |
| 262 | |
| 263 | nwdiag_antialias = True |
| 264 | nwdiag_html_image_format = "SVG" |
| 265 | nwdiag_fontpath = [ |
| 266 | "_static/fonts/Inconsolata-Regular.ttf", |
| 267 | "_static/fonts/Inconsolata-Bold.ttf", |
| 268 | ] |
| 269 | |
| 270 | # -- Options for todo extension ---------------------------------------------- |
| 271 | # If true, `todo` and `todoList` produce output, else they produce nothing. |
| 272 | todo_include_todos = True |
| 273 | |
Andrea Campanella | 92bd59b | 2020-01-30 17:26:32 +0100 | [diff] [blame] | 274 | # -- Options for linkcheck --------------------------------------------------- |
| 275 | # The link checker strips off .md from links and then complains |
Andrea Campanella | 8245ff5 | 2021-10-06 11:50:03 +0200 | [diff] [blame] | 276 | linkcheck_ignore = [r'https://github.com/opencord/voltctl/blob/master/LICENSE', |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 277 | r'https://github.com/ciena/kind-voltha#voltha-up-configuration-options', |
| 278 | r'https://www.sphinx-doc.org', |
Andrea Campanella | 9f534c7 | 2021-03-19 18:44:27 +0100 | [diff] [blame] | 279 | r'https://github.com/opencord/bbsim/blob/master/docs/source/DMI_Server_README', |
Andrea Campanella | 8245ff5 | 2021-10-06 11:50:03 +0200 | [diff] [blame] | 280 | r'https://github.com/opencord/voltha-helm-charts/blob/master/README' |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 281 | ] |
Andrea Campanella | 92bd59b | 2020-01-30 17:26:32 +0100 | [diff] [blame] | 282 | |
Zack Williams | 071eda2 | 2019-05-15 18:19:51 -0700 | [diff] [blame] | 283 | # -- Configure recommonmark to use AutoStructify ----------------------------- |
| 284 | # Docs: https://recommonmark.readthedocs.io/en/latest/auto_structify.html |
| 285 | |
| 286 | import recommonmark |
| 287 | from recommonmark.transform import AutoStructify |
| 288 | |
| 289 | github_doc_root = 'https://github.com/opencord/voltha-docs' |
| 290 | |
| 291 | def setup(app): |
| 292 | |
| 293 | app.add_css_file('css/rtd_theme_mods.css') |
| 294 | |
| 295 | app.add_config_value('recommonmark_config', { |
| 296 | 'url_resolver': lambda url: github_doc_root + url, |
| 297 | 'auto_toc_tree_section': 'Contents', |
| 298 | }, True) |
| 299 | |
| 300 | app.add_transform(AutoStructify) |