/ 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 = ["displayio"]
 24  
 25  intersphinx_mapping = {
 26      "python": ("https://docs.python.org/3.4", None),
 27      "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 28  }
 29  
 30  # Add any paths that contain templates here, relative to this directory.
 31  templates_path = ["_templates"]
 32  
 33  source_suffix = ".rst"
 34  
 35  # The master toctree document.
 36  master_doc = "index"
 37  
 38  # General information about the project.
 39  project = "Adafruit ProgressBar Library"
 40  copyright = "2020 Brent Rubell"
 41  author = "Brent Rubell"
 42  
 43  # The version info for the project you're documenting, acts as replacement for
 44  # |version| and |release|, also used in various other places throughout the
 45  # built documents.
 46  #
 47  # The short X.Y version.
 48  version = "1.0"
 49  # The full version, including alpha/beta/rc tags.
 50  release = "1.0"
 51  
 52  # The language for content autogenerated by Sphinx. Refer to documentation
 53  # for a list of supported languages.
 54  #
 55  # This is also used if you do content translation via gettext catalogs.
 56  # Usually you set "language" from the command line for these cases.
 57  language = None
 58  
 59  # List of patterns, relative to source directory, that match files and
 60  # directories to ignore when looking for source files.
 61  # This patterns also effect to html_static_path and html_extra_path
 62  exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
 63  
 64  # The reST default role (used for this markup: `text`) to use for all
 65  # documents.
 66  #
 67  default_role = "any"
 68  
 69  # If true, '()' will be appended to :func: etc. cross-reference text.
 70  #
 71  add_function_parentheses = True
 72  
 73  # The name of the Pygments (syntax highlighting) style to use.
 74  pygments_style = "sphinx"
 75  
 76  # If true, `todo` and `todoList` produce output, else they produce nothing.
 77  todo_include_todos = False
 78  
 79  # If this is True, todo emits a warning for each TODO entries. The default is False.
 80  todo_emit_warnings = True
 81  
 82  napoleon_numpy_docstring = False
 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 = "AdafruitProgressbarLibrarydoc"
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          "AdafruitProgressBarLibrary.tex",
141          "AdafruitProgressBar 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          "AdafruitProgressBarlibrary",
155          "Adafruit ProgressBar 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          "AdafruitProgressBarLibrary",
170          "Adafruit ProgressBar Library Documentation",
171          author,
172          "AdafruitProgressBarLibrary",
173          "One line description of project.",
174          "Miscellaneous",
175      ),
176  ]