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 # TODO: Please Read! 21 # Uncomment the below if you use native CircuitPython modules such as 22 # digitalio, micropython and busio. List the modules you use. Without it, the 23 # autodoc module docs will fail to generate with a warning. 24 # autodoc_mock_imports = ["digitalio", "busio"] 25 # autodoc_mock_imports = ["digitalio"] 26 27 28 intersphinx_mapping = { 29 "python": ("https://docs.python.org/3.4", None), 30 "BusDevice": ( 31 "https://circuitpython.readthedocs.io/projects/busdevice/en/latest/", 32 None, 33 ), 34 "Register": ( 35 "https://circuitpython.readthedocs.io/projects/register/en/latest/", 36 None, 37 ), 38 "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None), 39 } 40 41 # Add any paths that contain templates here, relative to this directory. 42 templates_path = ["_templates"] 43 44 source_suffix = ".rst" 45 46 # The master toctree document. 47 master_doc = "index" 48 49 # General information about the project. 50 project = "Adafruit MatrixKeypad Library" 51 copyright = "2018 ladyada" 52 author = "ladyada" 53 54 # The version info for the project you're documenting, acts as replacement for 55 # |version| and |release|, also used in various other places throughout the 56 # built documents. 57 # 58 # The short X.Y version. 59 version = "1.0" 60 # The full version, including alpha/beta/rc tags. 61 release = "1.0" 62 63 # The language for content autogenerated by Sphinx. Refer to documentation 64 # for a list of supported languages. 65 # 66 # This is also used if you do content translation via gettext catalogs. 67 # Usually you set "language" from the command line for these cases. 68 language = None 69 70 # List of patterns, relative to source directory, that match files and 71 # directories to ignore when looking for source files. 72 # This patterns also effect to html_static_path and html_extra_path 73 exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"] 74 75 # The reST default role (used for this markup: `text`) to use for all 76 # documents. 77 # 78 default_role = "any" 79 80 # If true, '()' will be appended to :func: etc. cross-reference text. 81 # 82 add_function_parentheses = True 83 84 # The name of the Pygments (syntax highlighting) style to use. 85 pygments_style = "sphinx" 86 87 # If true, `todo` and `todoList` produce output, else they produce nothing. 88 todo_include_todos = False 89 90 # If this is True, todo emits a warning for each TODO entries. The default is False. 91 todo_emit_warnings = True 92 93 napoleon_numpy_docstring = False 94 95 # -- Options for HTML output ---------------------------------------------- 96 97 # The theme to use for HTML and HTML Help pages. See the documentation for 98 # a list of builtin themes. 99 # 100 on_rtd = os.environ.get("READTHEDOCS", None) == "True" 101 102 if not on_rtd: # only import and set the theme if we're building docs locally 103 try: 104 import sphinx_rtd_theme 105 106 html_theme = "sphinx_rtd_theme" 107 html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] 108 except: 109 html_theme = "default" 110 html_theme_path = ["."] 111 else: 112 html_theme_path = ["."] 113 114 # Add any paths that contain custom static files (such as style sheets) here, 115 # relative to this directory. They are copied after the builtin static files, 116 # so a file named "default.css" will overwrite the builtin "default.css". 117 html_static_path = ["_static"] 118 119 # The name of an image file (relative to this directory) to use as a favicon of 120 # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 121 # pixels large. 122 # 123 html_favicon = "_static/favicon.ico" 124 125 # Output file base name for HTML help builder. 126 htmlhelp_basename = "AdafruitMatrixkeypadLibrarydoc" 127 128 # -- Options for LaTeX output --------------------------------------------- 129 130 latex_elements = { 131 # The paper size ('letterpaper' or 'a4paper'). 132 # 133 # 'papersize': 'letterpaper', 134 # The font size ('10pt', '11pt' or '12pt'). 135 # 136 # 'pointsize': '10pt', 137 # Additional stuff for the LaTeX preamble. 138 # 139 # 'preamble': '', 140 # Latex figure (float) alignment 141 # 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 "AdafruitMatrixKeypadLibrary.tex", 152 "AdafruitMatrixKeypad 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 "AdafruitMatrixKeypadlibrary", 166 "Adafruit MatrixKeypad 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 "AdafruitMatrixKeypadLibrary", 181 "Adafruit MatrixKeypad Library Documentation", 182 author, 183 "AdafruitMatrixKeypadLibrary", 184 "One line description of project.", 185 "Miscellaneous", 186 ), 187 ]