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