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