-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc]: Spurious references from API to gallery examples #22036
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
Comments
No that is not correct. The admonition was added because many references were not being made, but the automatic references are indeed meant to show up this way. |
so that means that I should list in the admonition only those functions that are not automatically turned into a link by sphinx?
is this really useful?
|
I don't think it makes any practical difference to people adding admonitions. They can list things here, or not, based on that advice, some of which will be duplicate with the automatic cross linking. I suppose you could make the case that we get rid of the automatic cross links, but I'm personally of the opinion more cross linking is good. |
What is linked and what not is determined by sphinx-gallery (see https://sphinx-gallery.github.io/stable/configuration.html#references-to-examples):
(1) depends on how good the parser can infer types. Sometimes it works sometimes it doesn’t. The references admonition is intended to list the most relevant API. This has two purposes: A) It‘s an explicit summary of API worth mentioning in the example. Whether one adds something to the admonition should mainly be determined by A) and not depend on whether the autodetection (1) works or not. One could argue that the flaky auto-detection from doe (1) is undesirable. Suppressing it would need a respective option in sphinx-gallery. I‘m not aware that it exists. If it did, I‘d have a slight favor of suppressing the autogenerated links. |
So to summarize: I think the request here is reasonable, but would need action primarily in sphinx-gallery. |
Documentation Link
https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.set_axis_off.html
Problem
My understanding is that the API reference should only include links to gallery examples if the given API function is listed in the
.. admonition:: References
block of the example, see documentation and e.g. #19233 (comment). However, links seem to be generated for any function in the example, see for instanceset_axis_off
whereset_axis_off
is included in the references list in only 2 of the 9 linked gallery examples.plot
links to even 176 examples (there's hardly any example that's not linked to from there).(this is kind of the reverse of #19715)
Suggested improvement
Add links only to those gallery examples that explicitly list the given function in their references block.
Matplotlib Version
3.6.0.dev888+g25a54a4fef.d20211129
The text was updated successfully, but these errors were encountered: