-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sphinx-apidoc now uses the *.rst.jinja name format
- Loading branch information
Showing
4 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{%- if show_headings %} | ||
{{- basename.split(".")[-1] | e | heading }} | ||
{% endif -%} | ||
|
||
{%- set parts = basename.split('.') %} | ||
{%- set library_name = parts[0] %} | ||
{%- set module_name = parts[1] if parts | length > 1 else '' %} | ||
{%- set submodules = parts[2:] %} | ||
|
||
.. automodule:: {{ qualname }} | ||
{%- for option in automodule_options %} | ||
:{{ option }}: | ||
{%- endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{%- 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 is_namespace %} | ||
{{- [pkgname, "namespace"] | join(" ") | e | heading }} | ||
{% else %} | ||
{{- pkgname.split(".")[-1] | e | heading }} | ||
{% endif %} | ||
|
||
{%- if is_namespace %} | ||
.. py:module:: {{ pkgname }} | ||
{% endif %} | ||
|
||
{%- if modulefirst and not is_namespace %} | ||
{{ automodule(pkgname, automodule_options) }} | ||
{% endif %} | ||
|
||
{%- if subpackages %} | ||
|
||
{{ toctree(subpackages) }} | ||
{% endif %} | ||
|
||
{%- if submodules %} | ||
|
||
{% if separatemodules %} | ||
{{ toctree(submodules) }} | ||
{% else %} | ||
{%- for submodule in submodules %} | ||
{% if show_headings %} | ||
{{- submodule.split(".")[-1] | e | heading(2) }} | ||
{% endif %} | ||
{{ automodule(submodule, automodule_options) }} | ||
{% endfor %} | ||
{%- endif %} | ||
{%- endif %} | ||
|
||
{%- if not modulefirst and not is_namespace %} | ||
|
||
{{ automodule(pkgname, automodule_options) }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters