Skip to content

Add 'toctree' option to autosummary directive to generate stub pages #3927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

seisman
Copy link
Member

@seisman seisman commented Apr 23, 2025

https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html#directive-option-autosummary-toctree

The toctree option also signals to the sphinx-autogen script that stub pages should be generated for the entries listed in this directive.

As the documentation says, the autosummary directive needs the toctree option to trigger the generation of stub pages. Currently, the class template misses the toctree option. That's why the methods in the summary table are not clickable in https://pygmt-dev--3919.org.readthedocs.build/en/3919/api/generated/pygmt.GMTBackendEntrypoint.html (xref PR #3919).

This PR fixes the issue and also simplifies :toctree: ./ to :toctree: in other templates.

Tested the changes with PR #3919 and it works as expected.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Apr 23, 2025
@seisman seisman added this to the 0.16.0 milestone Apr 23, 2025
@seisman seisman removed the needs review This PR has higher priority and needs review. label Apr 24, 2025
@seisman seisman merged commit 926f808 into main Apr 24, 2025
12 checks passed
@seisman seisman deleted the doc/autosummary branch April 24, 2025 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants