Skip to content

Commit

Permalink
Restore templates; for real this time
Browse files Browse the repository at this point in the history
Signed-off-by: Shah, Karan <[email protected]>
  • Loading branch information
MasterSkepticista committed Dec 18, 2024
1 parent 9b5e457 commit 9d9cb14
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 7 deletions.
34 changes: 34 additions & 0 deletions docs/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -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 %}
66 changes: 66 additions & 0 deletions docs/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -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 %}
1 change: 1 addition & 0 deletions docs/openfl.component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

aggregator
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.cryptography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

ca
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.databases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

tensor_db
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.experimental.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

workflow.interface
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.federated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

plan
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

aggregation_functions
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.native.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

native
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

eden_pipeline
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

frameworks_adapters
Expand Down
1 change: 1 addition & 0 deletions docs/openfl.protocols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

interceptors
Expand Down
8 changes: 1 addition & 7 deletions docs/openfl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ Subpackages
openfl.plugins
openfl.protocols
openfl.transport
openfl.utilities


.. toctree::
:hidden:

openfl.interface
openfl.utilities
1 change: 1 addition & 0 deletions docs/openfl.transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

grpc
1 change: 1 addition & 0 deletions docs/openfl.utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

ca
Expand Down

0 comments on commit 9d9cb14

Please sign in to comment.