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