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