From 951538c402bb3b2326ea6a99fd1f26845682c554 Mon Sep 17 00:00:00 2001 From: Arnau Casau Date: Wed, 11 Oct 2023 16:21:31 +0200 Subject: [PATCH 1/2] Move methods into class pages for docs --- docs/_templates/autosummary/class.rst | 6 ++---- .../_templates/autosummary/class_no_inherited_members.rst | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst index a63062a73..f1a0d4a28 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/_templates/autosummary/class.rst @@ -18,11 +18,9 @@ .. rubric:: Attributes - .. autosummary:: - :toctree: ../stubs/ {% for item in all_attributes %} {%- if not item.startswith('_') %} - ~{{ name }}.{{ item }} + .. autoattribute:: {{ name }}.{{ item }} {%- endif -%} {%- endfor %} {% endif %} @@ -37,7 +35,7 @@ :toctree: ../stubs/ {% for item in all_methods %} {%- if not item.startswith('_') %} - ~{{ name }}.{{ item }} + .. automethod:: {{ name }}.{{ item }} {%- endif -%} {%- endfor %} diff --git a/docs/_templates/autosummary/class_no_inherited_members.rst b/docs/_templates/autosummary/class_no_inherited_members.rst index 0e83ca902..0ba35e8c4 100644 --- a/docs/_templates/autosummary/class_no_inherited_members.rst +++ b/docs/_templates/autosummary/class_no_inherited_members.rst @@ -18,12 +18,10 @@ .. rubric:: Attributes - .. autosummary:: - :toctree: ../stubs/ {% for item in all_attributes %} {%- if item not in inherited_members %} {%- if not item.startswith('_') %} - ~{{ name }}.{{ item }} + .. autoattribute:: {{ name }}.{{ item }} {%- endif -%} {%- endif %} {%- endfor %} @@ -35,12 +33,10 @@ .. rubric:: Methods - .. autosummary:: - :toctree: ../stubs/ {% for item in all_methods %} {%- if item not in inherited_members %} {%- if not item.startswith('_') %} - ~{{ name }}.{{ item }} + .. automethod:: {{ name }}.{{ item }} {%- endif -%} {%- endif %} {%- endfor %} From 08c1ce42edd3a3073432d19139fcc3373676ef8f Mon Sep 17 00:00:00 2001 From: Arnau Casau <47946624+arnaucasau@users.noreply.github.com> Date: Wed, 11 Oct 2023 16:23:30 +0200 Subject: [PATCH 2/2] Update class.rst --- docs/_templates/autosummary/class.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst index f1a0d4a28..14c2d7a84 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/_templates/autosummary/class.rst @@ -31,8 +31,6 @@ .. rubric:: Methods - .. autosummary:: - :toctree: ../stubs/ {% for item in all_methods %} {%- if not item.startswith('_') %} .. automethod:: {{ name }}.{{ item }}