Hide Search Matches

24 views
Skip to first unread message

Denis Bitouzé

unread,
Feb 9, 2021, 9:18:21 AM2/9/21
to sphinx...@googlegroups.com
Hi,

the Sphinx-doc documentation has the nice "Hide Search Matches" feature,
that one can see for instance at the bottom right of:

┌────
https://www.sphinx-doc.org/en/master/index.html?highlight=Sphinx
└────

the link of which being:

┌────
│ javascript:Documentation.hideSearchWords()
└────

How could I add this feature to my own Sphinx instance?

Thanks.
--
Denis

Matthias Geier

unread,
Feb 9, 2021, 12:37:13 PM2/9/21
to sphinx...@googlegroups.com
This feature is always available, but sadly, many Sphinx HTML themes
do not provide the "Hide Search Matches" link.

I have suggested to add this to the sphinx_rtd_theme, but this hasn't
happened (yet?):
https://github.com/readthedocs/sphinx_rtd_theme/pull/876

In my own theme, I have decided to put the "Hide Search Matches" link
into the header bar, see for example
https://insipid-sphinx-theme.readthedocs.io/en/0.2.2/configuration.html?highlight=Sphinx#sphinx-settings

You can try which themes support this at https://sphinx-themes.org/.

cheers,
Matthias

mahiviajes agencia en ligne

unread,
Feb 9, 2021, 1:00:21 PM2/9/21
to sphinx-users
hola , mi nombre es mamadou soumahoro de mahiviajes de madrid

Denis Bitouzé

unread,
Feb 9, 2021, 4:50:17 PM2/9/21
to Matthias Geier, sphinx...@googlegroups.com
Le 09/02/21 à 18h36, Matthias Geier a écrit :

> This feature is always available, but sadly, many Sphinx HTML themes
> do not provide the "Hide Search Matches" link.

Ah, good to know that it depends on themes! The one I'm using is Furo:

┌────
https://pradyunsg.me/furo/quickstart/
└────

> I have suggested to add this to the sphinx_rtd_theme, but this hasn't
> happened (yet?):
> https://github.com/readthedocs/sphinx_rtd_theme/pull/876

I have suggested it as well for Furo:

┌────
https://github.com/pradyunsg/furo/issues/81
└────

> In my own theme,

Very interesting! Many thanks for the very informative showcases that
let me discover some (for me) hidden features of Sphinx or
reStructuredText.

> I have decided to put the "Hide Search Matches" link
> into the header bar, see for example
> https://insipid-sphinx-theme.readthedocs.io/en/0.2.2/configuration.html?highlight=3DSphinx#sphinx-settings

Strange at a first glance, but it makes perfect sense :)

> You can try which themes support this at https://sphinx-themes.org/.

Not easy to figure out at first sight which themes support this
feature. What would be nice would be a matrix themes/features.

Many thanks!

Cheers.
--
Denis
Reply all
Reply to author
Forward
0 new messages