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