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