Skip to content

Use the minigallery directive to insert mini gallery in API documentation #2459

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 2 commits into from
Mar 28, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Mar 26, 2023

Description of proposed changes

Currently, the mini-gallery at the end of each API documentation is added using the following include directive:

.. include:: backreferences/{{ fullname }}.examples

This include directive was originally added to the class template in PR #383 (Nov, 2019) since there are no other way to insert mini galleries at that time. The same include directive was then added to the method and function template in PR #648 (Oct, 2020).

Since v0.7.0 (PR sphinx-gallery/sphinx-gallery#685, released in May, 2020), Sphinx-Gallery provided the minigallery directive (https://sphinx-gallery.github.io/stable/configuration.html#add-mini-galleries-for-api-documentation) to add mini gallery.

This PR replaces the outdated include directive with the better minigallery directive as suggested by the official sphinx-gallery documentation (https://sphinx-gallery.github.io/stable/configuration.html#add-mini-galleries-for-api-documentation).

Preview: https://pygmt-dev--2459.org.readthedocs.build/en/2459/api/index.html

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman seisman added the maintenance Boring but important stuff for the core devs label Mar 26, 2023
@seisman seisman added this to the 0.9.0 milestone Mar 26, 2023
@seisman seisman added the needs review This PR has higher priority and needs review. label Mar 26, 2023
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Mar 27, 2023
@seisman seisman merged commit 84cc34e into main Mar 28, 2023
@seisman seisman deleted the improve-minigallery branch March 28, 2023 12:30
@seisman seisman added skip-changelog Skip adding Pull Request to changelog and removed final review call This PR requires final review and approval from a second reviewer labels Mar 28, 2023
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.

3 participants