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