John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [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/stable/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 | |
Nathan Skrzypczak | 9ad39c0 | 2021-08-19 11:38:06 +0200 | [diff] [blame] | 19 | import subprocess |
| 20 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 21 | # -- Project information ----------------------------------------------------- |
| 22 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 23 | project = "The Vector Packet Processor" |
| 24 | copyright = "2018-2022, Linux Foundation" |
| 25 | author = "FD.io VPP Community" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 26 | |
| 27 | # The short X.Y version |
Nathan Skrzypczak | 9ad39c0 | 2021-08-19 11:38:06 +0200 | [diff] [blame] | 28 | version = subprocess.run(["git", "describe"], stdout=subprocess.PIPE, text=True).stdout |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 29 | # The full version, including alpha/beta/rc tags |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 30 | release = subprocess.run( |
| 31 | ["git", "describe", "--long"], stdout=subprocess.PIPE, text=True |
| 32 | ).stdout |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 33 | |
| 34 | |
| 35 | # -- General configuration --------------------------------------------------- |
| 36 | |
| 37 | # If your documentation needs a minimal Sphinx version, state it here. |
| 38 | # |
| 39 | # needs_sphinx = '1.0' |
| 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 = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 45 | "sphinx.ext.autodoc", |
| 46 | "sphinx.ext.viewcode", |
| 47 | "recommonmark", |
| 48 | "sphinxcontrib.spelling", |
| 49 | ] |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 50 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 51 | spelling_word_list_filename = "spelling_wordlist.txt" |
Nathan Skrzypczak | 9ad39c0 | 2021-08-19 11:38:06 +0200 | [diff] [blame] | 52 | |
| 53 | # do not spell check those files |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 54 | spelling_exclude_patterns = ["aboutvpp/releasenotes/*"] |
Nathan Skrzypczak | 9ad39c0 | 2021-08-19 11:38:06 +0200 | [diff] [blame] | 55 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 56 | # Add any paths that contain templates here, relative to this directory. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 57 | templates_path = ["_templates"] |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 58 | |
| 59 | # The suffix(es) of source filenames. |
| 60 | # You can specify multiple suffix as a list of string: |
| 61 | # |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 62 | source_suffix = {".rst": "restructuredtext", ".md": "markdown"} |
jdenisco | 8a6e1b1 | 2019-05-13 12:40:21 -0400 | [diff] [blame] | 63 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 64 | # The master toctree document. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 65 | master_doc = "index" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 66 | |
| 67 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 68 | # for a list of supported languages. |
| 69 | # |
| 70 | # This is also used if you do content translation via gettext catalogs. |
| 71 | # Usually you set "language" from the command line for these cases. |
| 72 | language = None |
| 73 | |
| 74 | # List of patterns, relative to source directory, that match files and |
| 75 | # directories to ignore when looking for source files. |
| 76 | # This pattern also affects html_static_path and html_extra_path . |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 77 | exclude_patterns = ["Thumbs.db", ".DS_Store", "_scripts", "venv", "_generated"] |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 78 | |
| 79 | # The name of the Pygments (syntax highlighting) style to use. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 80 | pygments_style = "default" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 81 | |
| 82 | |
| 83 | # -- Options for HTML output ------------------------------------------------- |
| 84 | |
| 85 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 86 | # a list of builtin themes. |
| 87 | # |
| 88 | |
| 89 | # import sphinx_theme |
| 90 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 91 | templates_path = ["_templates"] |
Nathan Skrzypczak | ae56097 | 2021-10-29 12:05:29 +0200 | [diff] [blame] | 92 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 93 | html_theme = "sphinx_rtd_theme" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 94 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 95 | html_theme_path = [ |
| 96 | "_themes", |
| 97 | ] |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 98 | |
| 99 | # The name of an image file (relative to this directory) to place at the top |
| 100 | # of the sidebar. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 101 | html_logo = "_static/fd-io_red_white.png" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 102 | |
| 103 | # Theme options are theme-specific and customize the look and feel of a theme |
| 104 | # further. For a list of options available for each theme, see the |
| 105 | # documentation. |
| 106 | # |
| 107 | # html_theme_options = {} |
| 108 | |
| 109 | # Add any paths that contain custom static files (such as style sheets) here, |
| 110 | # relative to this directory. They are copied after the builtin static files, |
| 111 | # so a file named "default.css" will overwrite the builtin "default.css". |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 112 | html_static_path = ["_static"] |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 113 | |
Paul Vinciguerra | 340c15c | 2019-11-05 15:34:36 -0500 | [diff] [blame] | 114 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 115 | def setup(app): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 116 | app.add_css_file("css/rules.css") |
| 117 | |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 118 | |
| 119 | # Custom sidebar templates, must be a dictionary that maps document names |
| 120 | # to template names. |
| 121 | # |
| 122 | # The default sidebars (for documents that don't match any pattern) are |
| 123 | # defined by theme itself. Builtin themes are using these templates by |
| 124 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 125 | # 'searchbox.html']``. |
| 126 | # |
| 127 | # html_sidebars = {} |
| 128 | |
| 129 | |
| 130 | # -- Options for HTMLHelp output --------------------------------------------- |
| 131 | |
| 132 | # Output file base name for HTML help builder. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 133 | htmlhelp_basename = "Vector Packet Processor" |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 134 | |
| 135 | |
| 136 | # -- Options for LaTeX output ------------------------------------------------ |
| 137 | |
| 138 | latex_elements = { |
| 139 | # The paper size ('letterpaper' or 'a4paper'). |
| 140 | # |
| 141 | # 'papersize': 'letterpaper', |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 142 | # The font size ('10pt', '11pt' or '12pt'). |
| 143 | # |
| 144 | # 'pointsize': '10pt', |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 145 | # Additional stuff for the LaTeX preamble. |
| 146 | # |
| 147 | # 'preamble': '', |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 148 | # Latex figure (float) alignment |
| 149 | # |
| 150 | # 'figure_align': 'htbp', |
| 151 | } |
| 152 | |
| 153 | # Grouping the document tree into LaTeX files. List of tuples |
| 154 | # (source start file, target name, title, |
| 155 | # author, documentclass [howto, manual, or own class]). |
| 156 | latex_documents = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 157 | ( |
| 158 | master_doc, |
| 159 | "Vector Packet Processor.tex", |
| 160 | "Vector Packet Processor Documentation", |
| 161 | "John DeNisco", |
| 162 | "manual", |
| 163 | ), |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 164 | ] |
| 165 | |
| 166 | |
| 167 | # -- Options for manual page output ------------------------------------------ |
| 168 | |
| 169 | # One entry per manual page. List of tuples |
| 170 | # (source start file, name, description, authors, manual section). |
| 171 | man_pages = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 172 | ( |
| 173 | master_doc, |
| 174 | "Vector Packet Processor", |
| 175 | "Vector Packet Processor Documentation", |
| 176 | [author], |
| 177 | 1, |
| 178 | ) |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 179 | ] |
| 180 | |
| 181 | |
| 182 | # -- Options for Texinfo output ---------------------------------------------- |
| 183 | |
| 184 | # Grouping the document tree into Texinfo files. List of tuples |
| 185 | # (source start file, target name, title, author, |
| 186 | # dir menu entry, description, category) |
| 187 | texinfo_documents = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 188 | ( |
| 189 | master_doc, |
| 190 | "Vector Packet Processor", |
| 191 | "Vector Packet Processor Documentation", |
| 192 | author, |
| 193 | "Vector Packet Processor", |
| 194 | "One line description of project.", |
| 195 | "Miscellaneous", |
| 196 | ), |
John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame] | 197 | ] |
| 198 | |
| 199 | |
| 200 | # -- Extension configuration ------------------------------------------------- |