Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Reactivate search for codex #11169

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
May 5, 2018

Conversation

ImportanceOfBeingErnest
Copy link
Member

PR Summary

Fixes #11151 (DOC: In search for the matplotlib codex Documentation)

That is, previously the search could be limited to code examples by typing "codex" in the search field. This got lost in the transfer to sphinx-gallery.

This PR fixes this by monkey patching the sphinx-gallery signature and putting adding the search terms to it. The signature stays invisible so the search terms are not shown in the actual output.

@@ -986,7 +986,7 @@ div.sphx-glr-download a {
background-image: none !important;
}

p.sphx-glr-signature a.reference.external {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to drop the css for a.reference.external?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because I want to hide not only the <a> tag but the outer <p> tag.
It can of course be discussed whether the search keywords should still be shown on the page. In my opinion that just distracts and is not really useful.

@jklymak jklymak added this to the v2.2.3 milestone May 4, 2018
@tacaswell tacaswell modified the milestones: v2.2.3, v2.2-doc May 5, 2018
@tacaswell
Copy link
Member

This can be backported to 2.2.2-doc as it is only touching thing in the doc folder.

@tacaswell tacaswell merged commit fa0970b into matplotlib:master May 5, 2018
@tacaswell
Copy link
Member

Thanks @ImportanceOfBeingErnest !

lumberbot-app bot pushed a commit that referenced this pull request May 5, 2018
jklymak added a commit that referenced this pull request May 6, 2018
@ImportanceOfBeingErnest ImportanceOfBeingErnest deleted the search-codex branch May 6, 2018 23:17
@@ -17,6 +17,9 @@
import matplotlib
import sphinx

# This is only necessary to monkey patch the signature later on.
from sphinx_gallery import gen_rst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved below the _check_deps call below to prevent ImportErrors when sphinx-gallery is not yet installed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a new PR #11221 for that. Thanks for taking a close look.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: In search for the matplotlib codex
5 participants