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