Skip to content

Commit

Permalink
docs: update api docs with template
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Dec 10, 2023
1 parent 4b97d66 commit 116f06e
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 42 deletions.
7 changes: 7 additions & 0 deletions docs/_templates/module.rst_t
@@ -0,0 +1,7 @@
{%- if show_headings %}
{{- basename | e | heading(2) }}
{% endif -%}
.. automodule:: {{ qualname }}
{%- for option in automodule_options %}
:{{ option }}:
{%- endfor %}
36 changes: 36 additions & 0 deletions docs/_templates/package.rst_t
@@ -0,0 +1,36 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if submodules %}
API Reference
-------------
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- submodule | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}

{%- if not modulefirst and not is_namespace %}
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{% endif %}
7 changes: 7 additions & 0 deletions docs/_templates/toc.rst_t
@@ -0,0 +1,7 @@
{{ header | heading }}

.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
42 changes: 0 additions & 42 deletions docs/api.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/api/antarctic_plots.fetch.rst
@@ -0,0 +1,6 @@
antarctic\_plots.fetch
----------------------
.. automodule:: antarctic_plots.fetch
:members:
:undoc-members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/api/antarctic_plots.maps.rst
@@ -0,0 +1,6 @@
antarctic\_plots.maps
---------------------
.. automodule:: antarctic_plots.maps
:members:
:undoc-members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/api/antarctic_plots.profile.rst
@@ -0,0 +1,6 @@
antarctic\_plots.profile
------------------------
.. automodule:: antarctic_plots.profile
:members:
:undoc-members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/api/antarctic_plots.regions.rst
@@ -0,0 +1,6 @@
antarctic\_plots.regions
------------------------
.. automodule:: antarctic_plots.regions
:members:
:undoc-members:
:show-inheritance:
12 changes: 12 additions & 0 deletions docs/api/antarctic_plots.rst
@@ -0,0 +1,12 @@

API Reference
-------------

.. toctree::
:maxdepth: 4

antarctic_plots.fetch
antarctic_plots.maps
antarctic_plots.profile
antarctic_plots.regions
antarctic_plots.utils
6 changes: 6 additions & 0 deletions docs/api/antarctic_plots.utils.rst
@@ -0,0 +1,6 @@
antarctic\_plots.utils
----------------------
.. automodule:: antarctic_plots.utils
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 116f06e

Please sign in to comment.