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