diff --git a/doc/_templates/custom-class-template.rst b/doc/_templates/custom-class-template.rst new file mode 100644 index 0000000..e875da1 --- /dev/null +++ b/doc/_templates/custom-class-template.rst @@ -0,0 +1,35 @@ +{{ fullname | escape | underline}} + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + :members: + :special-members: __init__, __call__ + + {% block methods %} + {# We go through this circumlocution because __call__ for some reason #} + {# does not show up in the list of methods, only in the list of members. #} + {# If we do not do this, the full documentation of __call__ will show up, #} + {# but its entry in autosummary will not. #} + {% if methods or '__call__' in members %} + .. rubric:: {{ _('Methods') }} + + .. autosummary:: + {% for item in members %} + {% if item in methods or item == '__call__' %} + ~{{ name }}.{{ item }} + {% endif %} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block attributes %} + {% if attributes %} + .. rubric:: {{ _('Attributes') }} + + .. autosummary:: + {% for item in attributes %} + ~{{ name }}.{{ item }} + {%- endfor %} + {% endif %} + {% endblock %} diff --git a/doc/api.rst b/doc/api.rst index b78d367..656bc20 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -6,8 +6,8 @@ API $\partial$SGP4 API .. autosummary:: - :toctree: _autosummary - :maxdepth: 3 + :toctree: _autosummary/ + :recursive: dsgp4 dsgp4.plot.plot_orbit @@ -49,4 +49,14 @@ $\partial$SGP4 API dsgp4.sgp4init.sgp4init dsgp4.sgp4init_batch.sgp4init_batch dsgp4.sgp4init_batch.initl_batch + dsgp4.mldsgp4 + dsgp4.initl + dsgp4.newton_method + dsgp4.sgp4init + dsgp4.sgp4init_batch + +.. autosummary:: + :toctree: _autosummary + :template: custom-class-template.rst + dsgp4.mldsgp4.mldsgp4 diff --git a/doc/conf.py b/doc/conf.py index 86de34a..14ef556 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,6 +38,7 @@ extensions = ["myst_nb", "sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx", "sphinx.ext.autosummary","sphinx.ext.napoleon"] autosummary_generate = True +autosummary_imported_members = True napoleon_google_docstring = True napoleon_numpy_docstring = False