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