File tree Expand file tree Collapse file tree 11 files changed +124
-21
lines changed
{% if sphinx %}docs{% endif %} Expand file tree Collapse file tree 11 files changed +124
-21
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ cov.xml
5555
5656# Sphinx documentation
5757docs /_build /
58+ docs /_api
5859
5960# PyBuilder
6061target /
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ cov.xml
5555
5656# Sphinx documentation
5757docs /_build /
58+ docs /_api
5859
5960# PyBuilder
6061target /
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ Or if it is a commandline tool then you might put some example commands here:
3131
3232```
3333python -m {{package_name}} --version
34- ```
35- {% if sphinx %}
34+ ```{% if sphinx %}
35+
3636<!-- README only content. Anything below this line won't be included in index.md -->
3737
3838See {{docs_url}} for more detailed documentation.{% endif %}
Original file line number Diff line number Diff line change 1+ """Top level API.
2+
3+ .. data:: __version__
4+ :type: str
5+
6+ Version number as calculated by https://github.com/pypa/setuptools_scm
7+ """
8+
19from ._version import __version__
210
311__all__ = ["__version__" ]
Original file line number Diff line number Diff line change 11"""Interface for ``python -m {{package_name}}``."""
2+
23from argparse import ArgumentParser
34from collections.abc import Sequence
45
Original file line number Diff line number Diff line change 1+ :orphan:
2+
3+ ..
4+ This page is not included in the TOC tree, but must exist so that the
5+ autosummary pages are generated for {{ package_name }} and all its
6+ subpackages
7+
8+ API
9+ ===
10+
11+ .. autosummary::
12+ :toctree: _api
13+ :template: custom-module-template.rst
14+ :recursive:
15+
16+ {{ package_name }}
Original file line number Diff line number Diff line change 1+ {{ ('``' + fullname + ' ``') | underline }}
2+
3+ {%- set filtered_members = [] %}
4+ {%- for item in members %}
5+ {%- if item in functions + classes + exceptions + attributes %}
6+ {% set _ = filtered_members.append(item) %}
7+ {%- endif %}
8+ {%- endfor %}
9+
10+ .. automodule :: {{ fullname }}
11+ :members:
12+
13+ {% block modules %}
14+ {% if modules %}
15+ .. rubric :: Submodules
16+
17+ .. autosummary ::
18+ :toctree:
19+ :template: custom-module-template.rst
20+ :recursive:
21+ {% for item in modules %}
22+ {{ item }}
23+ {%- endfor %}
24+ {% endif %}
25+ {% endblock %}
26+
27+ {% block members %}
28+ {% if filtered_members %}
29+ .. rubric :: Members
30+
31+ .. autosummary ::
32+ :nosignatures:
33+ {% for item in filtered_members %}
34+ {{ item }}
35+ {%- endfor %}
36+ {% endif %}
37+ {% endblock %}
Original file line number Diff line number Diff line change 3333extensions = [
3434 # Use this for generating API docs
3535 "sphinx.ext.autodoc",
36+ # and making summary tables at the top of API docs
37+ "sphinx.ext.autosummary",
3638 # This can parse google style docstrings
3739 "sphinx.ext.napoleon",
3840 # For linking to external sphinx documentation
@@ -81,6 +83,12 @@ autodoc_member_order = "bysource"
8183# Don't inherit docstrings from baseclasses
8284autodoc_inherit_docstrings = False
8385
86+ # Document only what is in __all__
87+ autosummary_ignore_module_all = False
88+
89+ # Add any paths that contain templates here, relative to this directory.
90+ templates_path = ["_templates"]
91+
8492# Output graphviz directive produced images in a scalable format
8593graphviz_output_format = "svg"
8694
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Technical reference material including APIs and release notes.
66:maxdepth: 1
77:glob:
88
9- reference/*
9+ API <_api/{{ package_name }}>
1010genindex
1111Release Notes <{{ repo_url }}/releases>
1212```
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments