Skip to content

Commit e17f451

Browse files
committed
DOC: Fix non-standard napoleon custom section mapping
Fix non-standard `napoleon` custom section mapping: - Map `Inputs` and `Outputs` to `params_style` and `returns_style`, respectively, instead of mapping them to `Parameters`. - Map `Mandatory Inputs` and `Optional Inputs` to `params_style`, instead of mapping them to `Parameters`. - Add the `numpydoc` extension and set the `numpy_doc_show_class_members` and `autodoc_typehints` flags so that the `Attributes` docstrings are shown. Documentation: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#confval-napoleon_custom_sections https://stackoverflow.com/questions/72220924/sphinx-how-to-show-attributes-as-in-scipy
1 parent 8465bb2 commit e17f451

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/conf.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
"sphinxcontrib.apidoc",
4646
"nipype.sphinxext.plot_workflow",
4747
"nipype.sphinxext.apidoc",
48+
"numpydoc",
4849
]
50+
numpydoc_show_class_members = False
51+
autodoc_typehints = "none"
4952

5053
autodoc_mock_imports = [
5154
"dipy",
@@ -67,11 +70,11 @@
6770
# https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
6871
napoleon_use_param = False
6972
napoleon_custom_sections = [
70-
("Inputs", "Parameters"),
71-
("Outputs", "Parameters"),
72-
("Attributes", "Parameters"),
73-
("Mandatory Inputs", "Parameters"),
74-
("Optional Inputs", "Parameters"),
73+
("Inputs", "params_style"),
74+
("Outputs", "returns_style"),
75+
("Attributes", "Attributes"),
76+
("Mandatory Inputs", "params_style"),
77+
("Optional Inputs", "params_style"),
7578
]
7679

7780
# Add any paths that contain templates here, relative to this directory.

0 commit comments

Comments
 (0)