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