From f23f5c2a072d711bee14a44beb3f389313849ed1 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 12 Sep 2024 11:23:57 -0600 Subject: [PATCH] WIP read numpy-style docstrings --- doc/source/conf.py | 12 ++++++++++++ requirements-docs.txt | 1 + 2 files changed, 13 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0303f72ca..97a436417 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -32,7 +32,9 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinx_autodoc_typehints", "sphinx.ext.autosectionlabel", + "sphinx.ext.napoleon", "numpydoc", # "sphinx.ext.autosummary", "myst_nb", @@ -79,6 +81,16 @@ nb_execution_mode = "off" suppress_warnings = ["myst.header"] # suppress non-consecutive header warning +# -- Options for autodoc ----------------------------------------------------- + +# Show the typehints in the description of each object instead of the signature. +autodoc_typehints = "description" + +# Show the default value for a parameter after the description within parents, e.g. +# (default: "foo") +typehints_defaults = "braces-after" + + # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/requirements-docs.txt b/requirements-docs.txt index 51dc9ff5a..68052ab3f 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -6,6 +6,7 @@ numpydoc pybtex pygithub sphinx>=4.3 +sphinx-autodoc-typehints sphinx-panels sphinx_rtd_theme>=1.0 sphinxcontrib-bibtex