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