From 9d9cb14fad40e3a41b304870ec29f2d6f3ae7753 Mon Sep 17 00:00:00 2001 From: "Shah, Karan" Date: Wed, 18 Dec 2024 14:57:13 +0530 Subject: [PATCH] Restore templates; for real this time Signed-off-by: Shah, Karan --- docs/_templates/custom-class-template.rst | 34 +++++++++++ docs/_templates/custom-module-template.rst | 66 ++++++++++++++++++++++ docs/openfl.component.rst | 1 + docs/openfl.cryptography.rst | 1 + docs/openfl.databases.rst | 1 + docs/openfl.experimental.rst | 1 + docs/openfl.federated.rst | 1 + docs/openfl.interface.rst | 1 + docs/openfl.native.rst | 1 + docs/openfl.pipelines.rst | 1 + docs/openfl.plugins.rst | 1 + docs/openfl.protocols.rst | 1 + docs/openfl.rst | 8 +-- docs/openfl.transport.rst | 1 + docs/openfl.utilities.rst | 1 + 15 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 docs/_templates/custom-class-template.rst create mode 100644 docs/_templates/custom-module-template.rst diff --git a/docs/_templates/custom-class-template.rst b/docs/_templates/custom-class-template.rst new file mode 100644 index 0000000000..d64b80d51c --- /dev/null +++ b/docs/_templates/custom-class-template.rst @@ -0,0 +1,34 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :show-inheritance: + :inherited-members: + :special-members: __call__, __add__, __mul__ + + {% block methods %} + {% if methods %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + :nosignatures: + {% for item in methods %} + {%- if not item.startswith('_') %} + ~{{ name }}.{{ item }} + {%- endif -%} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/docs/_templates/custom-module-template.rst b/docs/_templates/custom-module-template.rst new file mode 100644 index 0000000000..ec6b7ab05d --- /dev/null +++ b/docs/_templates/custom-module-template.rst @@ -0,0 +1,66 @@ +{{ fullname | escape | underline}} + +.. automodule:: {{ fullname }} + :members: + {% block attributes %} + {% if attributes %} + .. rubric:: Module attributes + + .. autosummary:: + :toctree: + {% for item in attributes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: + :nosignatures: + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: + :template: custom-class-template.rst + :nosignatures: + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block exceptions %} + {% if exceptions %} + .. rubric:: {{ _('Exceptions') }} + + .. autosummary:: + :toctree: + {% for item in exceptions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + +{% block modules %} +{% if modules %} +.. autosummary:: + :toctree: + :template: custom-module-template.rst + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} \ No newline at end of file diff --git a/docs/openfl.component.rst b/docs/openfl.component.rst index 4d440fa0b6..978197bd7b 100644 --- a/docs/openfl.component.rst +++ b/docs/openfl.component.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: aggregator diff --git a/docs/openfl.cryptography.rst b/docs/openfl.cryptography.rst index debc2c36a9..32b7cfeceb 100644 --- a/docs/openfl.cryptography.rst +++ b/docs/openfl.cryptography.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: ca diff --git a/docs/openfl.databases.rst b/docs/openfl.databases.rst index 00f6470041..7239032ee8 100644 --- a/docs/openfl.databases.rst +++ b/docs/openfl.databases.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: tensor_db diff --git a/docs/openfl.experimental.rst b/docs/openfl.experimental.rst index 6f23333447..b144159b8b 100644 --- a/docs/openfl.experimental.rst +++ b/docs/openfl.experimental.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: workflow.interface diff --git a/docs/openfl.federated.rst b/docs/openfl.federated.rst index 7eb0f482e3..2210a29eae 100644 --- a/docs/openfl.federated.rst +++ b/docs/openfl.federated.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: plan diff --git a/docs/openfl.interface.rst b/docs/openfl.interface.rst index a176d14787..1542f7a0df 100644 --- a/docs/openfl.interface.rst +++ b/docs/openfl.interface.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: aggregation_functions diff --git a/docs/openfl.native.rst b/docs/openfl.native.rst index a16b26fe6d..33fdbb1914 100644 --- a/docs/openfl.native.rst +++ b/docs/openfl.native.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: native diff --git a/docs/openfl.pipelines.rst b/docs/openfl.pipelines.rst index 21ecbea62c..30d169b64b 100644 --- a/docs/openfl.pipelines.rst +++ b/docs/openfl.pipelines.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: eden_pipeline diff --git a/docs/openfl.plugins.rst b/docs/openfl.plugins.rst index 1985f97509..a459bfd316 100644 --- a/docs/openfl.plugins.rst +++ b/docs/openfl.plugins.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: frameworks_adapters diff --git a/docs/openfl.protocols.rst b/docs/openfl.protocols.rst index 9425a9ada9..39cbada5b2 100644 --- a/docs/openfl.protocols.rst +++ b/docs/openfl.protocols.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: interceptors diff --git a/docs/openfl.rst b/docs/openfl.rst index 6b7430752f..9d053c2173 100644 --- a/docs/openfl.rst +++ b/docs/openfl.rst @@ -20,10 +20,4 @@ Subpackages openfl.plugins openfl.protocols openfl.transport - openfl.utilities - - -.. toctree:: - :hidden: - - openfl.interface + openfl.utilities \ No newline at end of file diff --git a/docs/openfl.transport.rst b/docs/openfl.transport.rst index 4ae89ba05d..5ec55236ed 100644 --- a/docs/openfl.transport.rst +++ b/docs/openfl.transport.rst @@ -7,6 +7,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: grpc diff --git a/docs/openfl.utilities.rst b/docs/openfl.utilities.rst index 0b527d8682..8e970bf3ab 100644 --- a/docs/openfl.utilities.rst +++ b/docs/openfl.utilities.rst @@ -8,6 +8,7 @@ .. autosummary:: :toctree: _autosummary + :template: custom-module-template.rst :recursive: ca