/ 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      "micropython",
 26      "busio",
 27      "adafruit_bus_device",
 28      "adafruit_register",
 29  ]
 30  
 31  
 32  intersphinx_mapping = {
 33      "python": ("https://docs.python.org/3.4", None),
 34      "BusDevice": (
 35          "https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
 36          None,
 37      ),
 38      "Register": (
 39          "https://circuitpython.readthedocs.io/projects/register/en/latest/",
 40          None,
 41      ),
 42      "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 43  }
 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 INA260 Library"
 55  copyright = "2019 Bryan Siepert"
 56  author = "Bryan Siepert"
 57  
 58  # The version info for the project you're documenting, acts as replacement for
 59  # |version| and |release|, also used in various other places throughout the
 60  # built documents.
 61  #
 62  # The short X.Y version.
 63  version = "1.0"
 64  # The full version, including alpha/beta/rc tags.
 65  release = "1.0"
 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 patterns also effect to html_static_path and html_extra_path
 77  exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
 78  
 79  # The reST default role (used for this markup: `text`) to use for all
 80  # documents.
 81  #
 82  default_role = "any"
 83  
 84  # If true, '()' will be appended to :func: etc. cross-reference text.
 85  #
 86  add_function_parentheses = True
 87  
 88  # The name of the Pygments (syntax highlighting) style to use.
 89  pygments_style = "sphinx"
 90  
 91  # If true, `todo` and `todoList` produce output, else they produce nothing.
 92  todo_include_todos = False
 93  
 94  # If this is True, todo emits a warning for each TODO entries. The default is False.
 95  todo_emit_warnings = True
 96  
 97  napoleon_numpy_docstring = False
 98  
 99  # -- Options for HTML output ----------------------------------------------
100  
101  # The theme to use for HTML and HTML Help pages.  See the documentation for
102  # a list of builtin themes.
103  #
104  on_rtd = os.environ.get("READTHEDOCS", None) == "True"
105  
106  if not on_rtd:  # only import and set the theme if we're building docs locally
107      try:
108          import sphinx_rtd_theme
109  
110          html_theme = "sphinx_rtd_theme"
111          html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
112      except:
113          html_theme = "default"
114          html_theme_path = ["."]
115  else:
116      html_theme_path = ["."]
117  
118  # Add any paths that contain custom static files (such as style sheets) here,
119  # relative to this directory. They are copied after the builtin static files,
120  # so a file named "default.css" will overwrite the builtin "default.css".
121  html_static_path = ["_static"]
122  
123  # The name of an image file (relative to this directory) to use as a favicon of
124  # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
125  # pixels large.
126  #
127  html_favicon = "_static/favicon.ico"
128  
129  # Output file base name for HTML help builder.
130  htmlhelp_basename = "AdafruitIna260Librarydoc"
131  
132  # -- Options for LaTeX output ---------------------------------------------
133  
134  latex_elements = {
135      # The paper size ('letterpaper' or 'a4paper').
136      #
137      # 'papersize': 'letterpaper',
138      # The font size ('10pt', '11pt' or '12pt').
139      #
140      # 'pointsize': '10pt',
141      # Additional stuff for the LaTeX preamble.
142      #
143      # 'preamble': '',
144      # Latex figure (float) alignment
145      #
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          "AdafruitINA260Library.tex",
156          "AdafruitINA260 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          "AdafruitINA260library",
170          "Adafruit INA260 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          "AdafruitINA260Library",
185          "Adafruit INA260 Library Documentation",
186          author,
187          "AdafruitINA260Library",
188          "One line description of project.",
189          "Miscellaneous",
190      ),
191  ]