-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: put the gallery keywords in the meta tag #22405
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
Conversation
…p] [skip appveyor]
doc/conf.py
Outdated
.. only:: html | ||
|
||
.. rst-class:: sphx-glr-signature | ||
.. meta:: | ||
:keywords: matplotlib code example, codex, python plot, pyplot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the exact keywords are up for discussion.
With this PR the gallery, tutorials etc now have |
doc/conf.py
Outdated
.. only:: html | ||
|
||
.. rst-class:: sphx-glr-signature | ||
.. meta:: | ||
:keywords: matplotlib code example, codex, python plot, pyplot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so the keywords come from a template and are the same for all gallery pages. That makes them relatively unhelpful. I think we can remove everything but 'codex'
:keywords: matplotlib code example, codex, python plot, pyplot | |
:keywords: codex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? "Codex matplotlib ellipse" and "code example matplotlib ellipse" seem identical in search. Not sure if "code example matplotlib" would work as well? "Gallery matplotlib ellipse" also works. "Matplotlib ellipse" returns the method, so there is some benefit to adding "example" in the kwargs I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused what are keywords and what are example search strings in your answer.
Also, can somebody who understands the topic please clarify what the effect of these keywords is. Is that just some strings we put intro the site so that search can find these strings somewhere? Is this only for the internal search or is this targeted at external search engines as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just talking about google search terms. OTOH it seems that google ignores the keyword tag, so maybe this is not worth doing, or maybe we should explicitly include as we were before.
I have no idea how the internal search works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, google does not use the keywords meta tag. If we want to add it, that should be for our internal purposes. And the only internal keyword purpose I see is the "codex" flag. Therefore my suggestion to delete everything else, we don't need to communicate to our internal search that we're matplotlib or about python plotting. The only thing I know about the internal search is that it's javascript that somehow parses the html sources. Empirically, this PR shows that "codex" is still found in the keywords meta tag. That's why I suggested to only keep "codex".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test that checks the header of Sphinx gallery against a copy of the unmodified version? That way we will be notified if sphinx gallery changes the content and we can adapt our modified version.
is there anything holding this PR up or did it just fall off the radar? |
I don't think there is any harm in this going it. May not particularly help though if google actually ignores keyword. |
We have copied the EXAMPLE_HEADER and patched it (matplotlib#22405). This ensures we are notified if sphinx-gallery changes the EXAMPLE_HEADER. See the test docstring for more details.
We have copied the EXAMPLE_HEADER and patched it (matplotlib#22405). This ensures we are notified if sphinx-gallery changes the EXAMPLE_HEADER. See the test docstring for more details.
We have copied the EXAMPLE_HEADER and patched it (#22405). This ensures we are notified if sphinx-gallery changes the EXAMPLE_HEADER. See the test docstring for more details.
…lotlib#23092) We have copied the EXAMPLE_HEADER and patched it (matplotlib#22405). This ensures we are notified if sphinx-gallery changes the EXAMPLE_HEADER. See the test docstring for more details.
PR Summary
Closes #22391
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).