File: search-hide.md

package info (click to toggle)
sphinx-basic-ng 1.0.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 504 kB
  • sloc: python: 179; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# "Hide search matches" link

Sphinx provides functionality to hide search matches, after the user lands on a
page from search. This component exposes that to the user, allowing them to read
the content once they've found it, without being distracted by the highlights.

## Usage

```jinja
{% include "components/search-hide.html" %}
{% include "components/toggle-sidebar-secondary.html" %}
```

This will add a single empty `div`, with the id `searchbox`. When a page has
highlights, Sphinx's built-in search JS will inject the following HTML into this
element:

```html
<p class="highlight-link">
  <a href="javascript:Documentation.hideSearchWords()">Hide Search Matches</a>
</p>
```

## Configurability

None.