/ 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  
 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      "Register": (
 38          "https://circuitpython.readthedocs.io/projects/register/en/latest/",
 39          None,
 40      ),
 41      "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 42  }
 43  
 44  # Add any paths that contain templates here, relative to this directory.
 45  templates_path = ["_templates"]
 46  
 47  source_suffix = ".rst"
 48  
 49  # The master toctree document.
 50  master_doc = "index"
 51  
 52  # General information about the project.
 53  project = "Adafruit PCF8591 Library"
 54  copyright = "2020 Bryan Siepert"
 55  author = "Bryan Siepert"
 56  
 57  # The version info for the project you're documenting, acts as replacement for
 58  # |version| and |release|, also used in various other places throughout the
 59  # built documents.
 60  #
 61  # The short X.Y version.
 62  version = "1.0"
 63  # The full version, including alpha/beta/rc tags.
 64  release = "1.0"
 65  
 66  # The language for content autogenerated by Sphinx. Refer to documentation
 67  # for a list of supported languages.
 68  #
 69  # This is also used if you do content translation via gettext catalogs.
 70  # Usually you set "language" from the command line for these cases.
 71  language = None
 72  
 73  # List of patterns, relative to source directory, that match files and
 74  # directories to ignore when looking for source files.
 75  # This patterns also effect to html_static_path and html_extra_path
 76  exclude_patterns = [
 77      "_build",
 78      "Thumbs.db",
 79      ".DS_Store",
 80      ".env",
 81      "CODE_OF_CONDUCT.md",
 82  ]
 83  
 84  # The reST default role (used for this markup: `text`) to use for all
 85  # documents.
 86  #
 87  default_role = "any"
 88  
 89  # If true, '()' will be appended to :func: etc. cross-reference text.
 90  #
 91  add_function_parentheses = True
 92  
 93  # The name of the Pygments (syntax highlighting) style to use.
 94  pygments_style = "sphinx"
 95  
 96  # If true, `todo` and `todoList` produce output, else they produce nothing.
 97  todo_include_todos = False
 98  
 99  # If this is True, todo emits a warning for each TODO entries. The default is False.
100  todo_emit_warnings = True
101  
102  napoleon_numpy_docstring = False
103  
104  # -- Options for HTML output ----------------------------------------------
105  
106  # The theme to use for HTML and HTML Help pages.  See the documentation for
107  # a list of builtin themes.
108  #
109  on_rtd = os.environ.get("READTHEDOCS", None) == "True"
110  
111  if not on_rtd:  # only import and set the theme if we're building docs locally
112      try:
113          import sphinx_rtd_theme
114  
115          html_theme = "sphinx_rtd_theme"
116          html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
117      except:
118          html_theme = "default"
119          html_theme_path = ["."]
120  else:
121      html_theme_path = ["."]
122  
123  # Add any paths that contain custom static files (such as style sheets) here,
124  # relative to this directory. They are copied after the builtin static files,
125  # so a file named "default.css" will overwrite the builtin "default.css".
126  html_static_path = ["_static"]
127  
128  # The name of an image file (relative to this directory) to use as a favicon of
129  # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
130  # pixels large.
131  #
132  html_favicon = "_static/favicon.ico"
133  
134  # Output file base name for HTML help builder.
135  htmlhelp_basename = "AdafruitPcf8591Librarydoc"
136  
137  # -- Options for LaTeX output ---------------------------------------------
138  
139  latex_elements = {
140      # The paper size ('letterpaper' or 'a4paper').
141      # 'papersize': 'letterpaper',
142      # The font size ('10pt', '11pt' or '12pt').
143      # 'pointsize': '10pt',
144      # Additional stuff for the LaTeX preamble.
145      # 'preamble': '',
146      # Latex figure (float) alignment
147      # 'figure_align': 'htbp',
148  }
149  
150  # Grouping the document tree into LaTeX files. List of tuples
151  # (source start file, target name, title,
152  #  author, documentclass [howto, manual, or own class]).
153  latex_documents = [
154      (
155          master_doc,
156          "AdafruitPCF8591Library.tex",
157          "AdafruitPCF8591 Library Documentation",
158          author,
159          "manual",
160      ),
161  ]
162  
163  # -- Options for manual page output ---------------------------------------
164  
165  # One entry per manual page. List of tuples
166  # (source start file, name, description, authors, manual section).
167  man_pages = [
168      (
169          master_doc,
170          "AdafruitPCF8591library",
171          "Adafruit PCF8591 Library Documentation",
172          [author],
173          1,
174      ),
175  ]
176  
177  # -- Options for Texinfo output -------------------------------------------
178  
179  # Grouping the document tree into Texinfo files. List of tuples
180  # (source start file, target name, title, author,
181  #  dir menu entry, description, category)
182  texinfo_documents = [
183      (
184          master_doc,
185          "AdafruitPCF8591Library",
186          "Adafruit PCF8591 Library Documentation",
187          author,
188          "AdafruitPCF8591Library",
189          "One line description of project.",
190          "Miscellaneous",
191      ),
192  ]