Skip to content

DOC: Reactivate search for codex - #11169

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
ImportanceOfBeingErnest:search-codex
May 5, 2018
Merged

tacaswell merged 1 commit into
matplotlib:masterfrom
ImportanceOfBeingErnest:search-codex

Conversation

@ImportanceOfBeingErnest

Copy link
Copy Markdown
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.

Comment thread doc/_static/mpl.css
background-image: none !important;
}

p.sphx-glr-signature a.reference.external {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Comment thread doc/conf.py
import sphinx

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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