/ docs / conf.py
conf.py
  1  # -*- coding: utf-8 -*-
  2  
  3  # SPDX-FileCopyrightText: 2019 ladyada for Adafruit Industries
  4  #
  5  # SPDX-License-Identifier: MIT
  6  
  7  import os
  8  import sys
  9  
 10  sys.path.insert(0, os.path.abspath(".."))
 11  
 12  # -- General configuration ------------------------------------------------
 13  
 14  # Add any Sphinx extension module names here, as strings. They can be
 15  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 16  # ones.
 17  extensions = [
 18      "sphinx.ext.autodoc",
 19      "sphinx.ext.intersphinx",
 20      "sphinx.ext.napoleon",
 21      "sphinx.ext.todo",
 22  ]
 23  
 24  # TODO: Please Read!
 25  # Uncomment the below if you use native CircuitPython modules such as
 26  # digitalio, micropython and busio. List the modules you use. Without it, the
 27  # autodoc module docs will fail to generate with a warning.
 28  # autodoc_mock_imports = ["digitalio", "busio"]
 29  
 30  
 31  intersphinx_mapping = {
 32      "python": ("https://docs.python.org/3.4", None),
 33      "BusDevice": (
 34          "https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
 35          None,
 36      ),
 37      "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 38  }
 39  
 40  # Add any paths that contain templates here, relative to this directory.
 41  templates_path = ["_templates"]
 42  
 43  source_suffix = ".rst"
 44  
 45  # The master toctree document.
 46  master_doc = "index"
 47  
 48  # General information about the project.
 49  project = "Adafruit ESP32SPI Library"
 50  copyright = "2019 ladyada"
 51  author = "ladyada"
 52  
 53  # The version info for the project you're documenting, acts as replacement for
 54  # |version| and |release|, also used in various other places throughout the
 55  # built documents.
 56  #
 57  # The short X.Y version.
 58  version = "1.0"
 59  # The full version, including alpha/beta/rc tags.
 60  release = "1.0"
 61  
 62  # The language for content autogenerated by Sphinx. Refer to documentation
 63  # for a list of supported languages.
 64  #
 65  # This is also used if you do content translation via gettext catalogs.
 66  # Usually you set "language" from the command line for these cases.
 67  language = None
 68  
 69  # List of patterns, relative to source directory, that match files and
 70  # directories to ignore when looking for source files.
 71  # This patterns also effect to html_static_path and html_extra_path
 72  exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
 73  
 74  # The reST default role (used for this markup: `text`) to use for all
 75  # documents.
 76  #
 77  default_role = "any"
 78  
 79  # If true, '()' will be appended to :func: etc. cross-reference text.
 80  #
 81  add_function_parentheses = True
 82  
 83  # The name of the Pygments (syntax highlighting) style to use.
 84  pygments_style = "sphinx"
 85  
 86  # If true, `todo` and `todoList` produce output, else they produce nothing.
 87  todo_include_todos = False
 88  
 89  # If this is True, todo emits a warning for each TODO entries. The default is False.
 90  todo_emit_warnings = True
 91  
 92  napoleon_numpy_docstring = False
 93  
 94  # -- Options for HTML output ----------------------------------------------
 95  
 96  # The theme to use for HTML and HTML Help pages.  See the documentation for
 97  # a list of builtin themes.
 98  #
 99  on_rtd = os.environ.get("READTHEDOCS", None) == "True"
100  
101  if not on_rtd:  # only import and set the theme if we're building docs locally
102      try:
103          import sphinx_rtd_theme
104  
105          html_theme = "sphinx_rtd_theme"
106          html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
107      except:
108          html_theme = "default"
109          html_theme_path = ["."]
110  else:
111      html_theme_path = ["."]
112  
113  # Add any paths that contain custom static files (such as style sheets) here,
114  # relative to this directory. They are copied after the builtin static files,
115  # so a file named "default.css" will overwrite the builtin "default.css".
116  html_static_path = ["_static"]
117  
118  # The name of an image file (relative to this directory) to use as a favicon of
119  # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
120  # pixels large.
121  #
122  html_favicon = "_static/favicon.ico"
123  
124  # Output file base name for HTML help builder.
125  htmlhelp_basename = "AdafruitEsp32spiLibrarydoc"
126  
127  # -- Options for LaTeX output ---------------------------------------------
128  
129  latex_elements = {
130      # The paper size ('letterpaper' or 'a4paper').
131      #
132      # 'papersize': 'letterpaper',
133      # The font size ('10pt', '11pt' or '12pt').
134      #
135      # 'pointsize': '10pt',
136      # Additional stuff for the LaTeX preamble.
137      #
138      # 'preamble': '',
139      # Latex figure (float) alignment
140      #
141      # 'figure_align': 'htbp',
142  }
143  
144  # Grouping the document tree into LaTeX files. List of tuples
145  # (source start file, target name, title,
146  #  author, documentclass [howto, manual, or own class]).
147  latex_documents = [
148      (
149          master_doc,
150          "AdafruitESP32SPILibrary.tex",
151          "AdafruitESP32SPI Library Documentation",
152          author,
153          "manual",
154      ),
155  ]
156  
157  # -- Options for manual page output ---------------------------------------
158  
159  # One entry per manual page. List of tuples
160  # (source start file, name, description, authors, manual section).
161  man_pages = [
162      (
163          master_doc,
164          "AdafruitESP32SPIlibrary",
165          "Adafruit ESP32SPI Library Documentation",
166          [author],
167          1,
168      )
169  ]
170  
171  # -- Options for Texinfo output -------------------------------------------
172  
173  # Grouping the document tree into Texinfo files. List of tuples
174  # (source start file, target name, title, author,
175  #  dir menu entry, description, category)
176  texinfo_documents = [
177      (
178          master_doc,
179          "AdafruitESP32SPILibrary",
180          "Adafruit ESP32SPI Library Documentation",
181          author,
182          "AdafruitESP32SPILibrary",
183          "One line description of project.",
184          "Miscellaneous",
185      ),
186  ]