/ 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 = ["digitalio", "busio", "micropython"]
 24  
 25  
 26  intersphinx_mapping = {
 27      "python": ("https://docs.python.org/3.4", None),
 28      "BusDevice": (
 29          "https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
 30          None,
 31      ),
 32      "Register": (
 33          "https://circuitpython.readthedocs.io/projects/register/en/latest/",
 34          None,
 35      ),
 36      "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 37  }
 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 FRAM Library"
 49  copyright = "2018 Michael Schroeder"
 50  author = "Michael Schroeder"
 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 = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
 72  
 73  # The reST default role (used for this markup: `text`) to use for all
 74  # documents.
 75  #
 76  default_role = "any"
 77  
 78  # If true, '()' will be appended to :func: etc. cross-reference text.
 79  #
 80  add_function_parentheses = True
 81  
 82  # The name of the Pygments (syntax highlighting) style to use.
 83  pygments_style = "sphinx"
 84  
 85  # If true, `todo` and `todoList` produce output, else they produce nothing.
 86  todo_include_todos = False
 87  
 88  # If this is True, todo emits a warning for each TODO entries. The default is False.
 89  todo_emit_warnings = True
 90  
 91  napoleon_numpy_docstring = False
 92  
 93  # -- Options for HTML output ----------------------------------------------
 94  
 95  # The theme to use for HTML and HTML Help pages.  See the documentation for
 96  # a list of builtin themes.
 97  #
 98  on_rtd = os.environ.get("READTHEDOCS", None) == "True"
 99  
100  if not on_rtd:  # only import and set the theme if we're building docs locally
101      try:
102          import sphinx_rtd_theme
103  
104          html_theme = "sphinx_rtd_theme"
105          html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
106      except:
107          html_theme = "default"
108          html_theme_path = ["."]
109  else:
110      html_theme_path = ["."]
111  
112  # Add any paths that contain custom static files (such as style sheets) here,
113  # relative to this directory. They are copied after the builtin static files,
114  # so a file named "default.css" will overwrite the builtin "default.css".
115  html_static_path = ["_static"]
116  
117  # The name of an image file (relative to this directory) to use as a favicon of
118  # the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
119  # pixels large.
120  #
121  html_favicon = "_static/favicon.ico"
122  
123  # Output file base name for HTML help builder.
124  htmlhelp_basename = "AdafruitFramLibrarydoc"
125  
126  # -- Options for LaTeX output ---------------------------------------------
127  
128  latex_elements = {
129      # The paper size ('letterpaper' or 'a4paper').
130      #
131      # 'papersize': 'letterpaper',
132      # The font size ('10pt', '11pt' or '12pt').
133      #
134      # 'pointsize': '10pt',
135      # Additional stuff for the LaTeX preamble.
136      #
137      # 'preamble': '',
138      # Latex figure (float) alignment
139      #
140      # 'figure_align': 'htbp',
141  }
142  
143  # Grouping the document tree into LaTeX files. List of tuples
144  # (source start file, target name, title,
145  #  author, documentclass [howto, manual, or own class]).
146  latex_documents = [
147      (
148          master_doc,
149          "AdafruitFRAMLibrary.tex",
150          "AdafruitFRAM Library Documentation",
151          author,
152          "manual",
153      ),
154  ]
155  
156  # -- Options for manual page output ---------------------------------------
157  
158  # One entry per manual page. List of tuples
159  # (source start file, name, description, authors, manual section).
160  man_pages = [
161      (
162          master_doc,
163          "AdafruitFRAMlibrary",
164          "Adafruit FRAM Library Documentation",
165          [author],
166          1,
167      )
168  ]
169  
170  # -- Options for Texinfo output -------------------------------------------
171  
172  # Grouping the document tree into Texinfo files. List of tuples
173  # (source start file, target name, title, author,
174  #  dir menu entry, description, category)
175  texinfo_documents = [
176      (
177          master_doc,
178          "AdafruitFRAMLibrary",
179          "Adafruit FRAM Library Documentation",
180          author,
181          "AdafruitFRAMLibrary",
182          "One line description of project.",
183          "Miscellaneous",
184      ),
185  ]