diff --git a/doc/conf.py b/doc/conf.py index 8d7428fe..29083848 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -22,13 +22,13 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", + "numpydoc", "sphinx.ext.coverage", "sphinx.ext.mathjax", "sphinx.ext.doctest", "sphinx.ext.viewcode", "sphinx.ext.extlinks", "sphinx.ext.intersphinx", - "sphinx.ext.napoleon", "sphinx_design", "sphinx_copybutton", "jupyter_sphinx", @@ -45,11 +45,12 @@ # Autosummary pages will be generated by sphinx-autogen instead of sphinx-build autosummary_generate = [] -# Otherwise, the Return parameter list looks different from the Parameters list -napoleon_use_rtype = False -# Otherwise, the Attributes parameter list looks different from the Parameters -# list -napoleon_use_ivar = True +# Create cross-references for the parameter types in the Parameters, Other +# Returns and Yields sections of the docstring +numpydoc_xref_param_type = True + +# Format the Attributes section like the Parameters section. +numpydoc_attributes_as_param_list = True # Sphinx project configuration templates_path = ["_templates"] diff --git a/env/requirements-docs.txt b/env/requirements-docs.txt index 396cfa7b..4edae106 100644 --- a/env/requirements-docs.txt +++ b/env/requirements-docs.txt @@ -1,5 +1,6 @@ # Requirements for building the documentation sphinx==7.2.* +numpydoc==1.7.* sphinx-book-theme==1.1.* sphinx-copybutton==0.5.* sphinx-design==0.5.* diff --git a/environment.yml b/environment.yml index 2668cb5f..5274b2a9 100644 --- a/environment.yml +++ b/environment.yml @@ -17,6 +17,7 @@ dependencies: - coverage # Documentation - sphinx==7.2.* + - numpydoc==1.7.* - sphinx-book-theme==1.1.* - sphinx-copybutton==0.5.* - sphinx-design==0.5.*