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