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