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