Zack Williams | 7f708f8 | 2020-07-07 12:18:20 -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 | |
| 19 | import os |
| 20 | |
| 21 | def get_version(): |
| 22 | with open("VERSION") as f: |
| 23 | return f.read().strip() |
| 24 | |
| 25 | # -- Project information ----------------------------------------------------- |
| 26 | |
| 27 | project = u'Aether Docs' |
| 28 | copyright = u'2020-current, Open Networking Foundation' |
| 29 | author = u'Open Networking Foundation' |
| 30 | |
| 31 | # The short X.Y version |
| 32 | version = get_version() |
| 33 | |
| 34 | # The full version, including alpha/beta/rc tags |
| 35 | release = version |
| 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 | 'sphinx.ext.coverage', |
| 51 | 'sphinx.ext.graphviz', |
| 52 | 'sphinx.ext.ifconfig', |
Zack Williams | 34c30e5 | 2020-11-16 10:55:00 -0700 | [diff] [blame] | 53 | 'sphinx.ext.intersphinx', |
Zack Williams | 7f708f8 | 2020-07-07 12:18:20 -0700 | [diff] [blame] | 54 | 'sphinx.ext.mathjax', |
| 55 | 'sphinx.ext.todo', |
| 56 | 'sphinxcontrib.spelling', |
| 57 | "sphinx_multiversion", |
| 58 | ] |
| 59 | |
| 60 | # Text files with lists of words that shouldn't fail the spellchecker: |
| 61 | spelling_word_list_filename=['dict.txt', ] |
| 62 | |
| 63 | # sphinx-multiversion prep, run in each versioned source directory |
| 64 | prep_commands = [ |
| 65 | ] |
| 66 | |
| 67 | # inlcude only the branches matching master and aether-* |
| 68 | smv_branch_whitelist = r'^(master|aether-.*)$' |
| 69 | |
| 70 | # include all remote branches |
| 71 | smv_remote_whitelist = r'^.*$' |
| 72 | |
| 73 | # Add any paths that contain templates here, relative to this directory. |
| 74 | templates_path = ['_templates'] |
| 75 | |
| 76 | # The suffix(es) of source filenames. |
| 77 | # You can specify multiple suffix as a list of string: |
| 78 | # |
| 79 | # source_suffix = ['.rst', '.md'] |
| 80 | source_suffix = ['.rst'] |
| 81 | |
| 82 | # The master toctree document. |
| 83 | master_doc = 'index' |
| 84 | |
| 85 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 86 | # for a list of supported languages. |
| 87 | # |
| 88 | # This is also used if you do content translation via gettext catalogs. |
| 89 | # Usually you set "language" from the command line for these cases. |
| 90 | language = None |
| 91 | |
| 92 | # List of patterns, relative to source directory, that match files and |
| 93 | # directories to ignore when looking for source files. |
| 94 | # This pattern also affects html_static_path and html_extra_path. |
| 95 | exclude_patterns = [ |
| 96 | '*/LICENSE.md', |
| 97 | '*/vendor', |
| 98 | '.DS_Store', |
| 99 | 'Thumbs.db', |
| 100 | '_build', |
Zack Williams | e8c3b2c | 2021-02-01 12:47:28 -0700 | [diff] [blame] | 101 | 'venv-docs', |
Zack Williams | 7f708f8 | 2020-07-07 12:18:20 -0700 | [diff] [blame] | 102 | 'requirements.txt', |
| 103 | ] |
| 104 | |
| 105 | # The name of the Pygments (syntax highlighting) style to use. |
| 106 | pygments_style = None |
| 107 | |
| 108 | # -- Options for HTML output ------------------------------------------------- |
| 109 | |
| 110 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 111 | # a list of builtin themes. |
| 112 | # |
| 113 | html_theme = 'sphinx_rtd_theme' |
| 114 | |
| 115 | html_logo = '_static/aether.svg' |
| 116 | |
| 117 | html_favicon = '_static/aether-favicon-128.png' |
| 118 | |
| 119 | # Theme options are theme-specific and customize the look and feel of a theme |
| 120 | # further. For a list of options available for each theme, see the |
| 121 | # documentation. |
| 122 | # |
| 123 | html_theme_options = { |
| 124 | 'logo_only': True |
| 125 | } |
| 126 | |
| 127 | # Add any paths that contain custom static files (such as style sheets) here, |
| 128 | # relative to this directory. They are copied after the builtin static files, |
| 129 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 130 | html_static_path = ['_static'] |
| 131 | |
| 132 | # Custom sidebar templates, must be a dictionary that maps document names |
| 133 | # to template names. |
| 134 | # |
| 135 | # The default sidebars (for documents that don't match any pattern) are |
| 136 | # defined by theme itself. Builtin themes are using these templates by |
| 137 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 138 | # 'searchbox.html']``. |
| 139 | # |
| 140 | # html_sidebars = {} |
| 141 | |
| 142 | # -- Options for HTMLHelp output --------------------------------------------- |
| 143 | |
| 144 | # Output file base name for HTML help builder. |
| 145 | htmlhelp_basename = 'AetherDocs' |
| 146 | |
| 147 | |
| 148 | # -- Options for LaTeX output ------------------------------------------------ |
| 149 | |
| 150 | latex_elements = { |
| 151 | # The paper size ('letterpaper' or 'a4paper'). |
| 152 | # |
| 153 | # 'papersize': 'letterpaper', |
| 154 | |
| 155 | # The font size ('10pt', '11pt' or '12pt'). |
| 156 | # |
| 157 | # 'pointsize': '10pt', |
| 158 | |
| 159 | # Additional stuff for the LaTeX preamble. |
| 160 | # |
| 161 | # 'preamble': '', |
| 162 | |
| 163 | # Latex figure (float) alignment |
| 164 | # |
| 165 | # 'figure_align': 'htbp', |
| 166 | } |
| 167 | |
| 168 | # Grouping the document tree into LaTeX files. List of tuples |
| 169 | # (source start file, target name, title, |
| 170 | # author, documentclass [howto, manual, or own class]). |
| 171 | latex_documents = [ |
| 172 | (master_doc, 'AetherDocs.tex', u'Aether Docs', |
| 173 | u'ONF', 'manual'), |
| 174 | ] |
| 175 | |
| 176 | |
| 177 | # -- Options for manual page output ------------------------------------------ |
| 178 | |
| 179 | # One entry per manual page. List of tuples |
| 180 | # (source start file, name, description, authors, manual section). |
| 181 | man_pages = [ |
| 182 | (master_doc, 'Aether Docs', u'Aether Docs', |
| 183 | [author], 1) |
| 184 | ] |
| 185 | |
| 186 | |
| 187 | # -- Options for Texinfo output ---------------------------------------------- |
| 188 | |
| 189 | # Grouping the document tree into Texinfo files. List of tuples |
| 190 | # (source start file, target name, title, author, |
| 191 | # dir menu entry, description, category) |
| 192 | texinfo_documents = [ |
| 193 | (master_doc, 'Aether Docs', u'Aether Docs', |
| 194 | author, 'AetherDocs', 'One line description of project.', |
| 195 | 'Miscellaneous'), |
| 196 | ] |
| 197 | |
| 198 | |
| 199 | # -- Options for Epub output ------------------------------------------------- |
| 200 | |
| 201 | # Bibliographic Dublin Core info. |
| 202 | epub_title = project |
| 203 | |
| 204 | # The unique identifier of the text. This can be a ISBN number |
| 205 | # or the project homepage. |
| 206 | # |
| 207 | # epub_identifier = '' |
| 208 | |
| 209 | # A unique identification for the text. |
| 210 | # |
| 211 | # epub_uid = '' |
| 212 | |
| 213 | # A list of files that should not be packed into the epub file. |
| 214 | epub_exclude_files = ['search.html'] |
| 215 | |
| 216 | |
| 217 | # -- Extension configuration ------------------------------------------------- |
| 218 | |
| 219 | # blockdiag/etc. config |
| 220 | |
| 221 | rackdiag_antialias = True |
| 222 | rackdiag_html_image_format = "SVG" |
| 223 | rackdiag_fontpath = [ |
| 224 | "_static/fonts/Inconsolata-Regular.ttf", |
| 225 | "_static/fonts/Inconsolata-Bold.ttf", |
| 226 | ] |
| 227 | |
| 228 | nwdiag_antialias = True |
| 229 | nwdiag_html_image_format = "SVG" |
| 230 | nwdiag_fontpath = [ |
| 231 | "_static/fonts/Inconsolata-Regular.ttf", |
| 232 | "_static/fonts/Inconsolata-Bold.ttf", |
| 233 | ] |
| 234 | |
| 235 | # -- Options for todo extension ---------------------------------------------- |
| 236 | # If true, `todo` and `todoList` produce output, else they produce nothing. |
| 237 | todo_include_todos = True |
| 238 | |
| 239 | # -- Options for linkcheck --------------------------------------------------- |
| 240 | # The link checker strips off .md from links and then complains |
| 241 | linkcheck_ignore = [ |
Hyunsun Moon | 5ca6bfb | 2020-10-29 22:29:12 -0700 | [diff] [blame] | 242 | r'https://jenkins\.opencord\.org/job/aether-member-only-jobs/.*' |
Zack Williams | 7f708f8 | 2020-07-07 12:18:20 -0700 | [diff] [blame] | 243 | ] |
| 244 | |
Zack Williams | 34c30e5 | 2020-11-16 10:55:00 -0700 | [diff] [blame] | 245 | # -- options for Intersphinx extension --------------------------------------- |
| 246 | |
| 247 | intersphinx_mapping = { |
Zack Williams | 9026f53 | 2020-11-30 11:34:32 -0700 | [diff] [blame] | 248 | 'ansible': ('https://docs.ansible.com/ansible/latest', None), |
Zack Williams | 34c30e5 | 2020-11-16 10:55:00 -0700 | [diff] [blame] | 249 | 'sphinx': ('https://www.sphinx-doc.org/en/master', None), |
| 250 | 'trellis': ('https://docs.trellisfabric.org/master', None), |
| 251 | } |
| 252 | |
Zack Williams | 7f708f8 | 2020-07-07 12:18:20 -0700 | [diff] [blame] | 253 | def setup(app): |
| 254 | |
| 255 | app.add_css_file('css/rtd_theme_mods.css') |
| 256 | |
| 257 | app.add_config_value('recommonmark_config', { |
| 258 | 'url_resolver': lambda url: github_doc_root + url, |
| 259 | 'auto_toc_tree_section': 'Contents', |
| 260 | }, True) |