You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
5.4 KiB

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