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