Skip to content

Commit ad74e78

Browse files
authored
Docs: update Sphinx instructions to override search (#11702)
- The selector may need to be adjusted based on the theme. - The script must be run after the DOM is loaded, so defer should be used.
1 parent f4b6ae7 commit ad74e78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/user/intro/sphinx.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ If you're using a different theme, enable :doc:`Server side search </server-side
8686
8787
8888
// Trigger the Read the Docs Addons Search modal when clicking on "Search docs" input from the topnav.
89+
// NOTE: The selector of the search input may need to be adjusted based on your theme.
8990
document.querySelector("[role='search'] input").addEventListener("focusin", () => {
9091
const event = new CustomEvent("readthedocs-search-show");
9192
document.dispatchEvent(event);
@@ -97,7 +98,7 @@ If you're using a different theme, enable :doc:`Server side search </server-side
9798
:caption: conf.py
9899
99100
html_js_files = [
100-
"readthedocs.js",
101+
("readthedocs.js", {"defer": "defer"}),
101102
]
102103
103104

0 commit comments

Comments
 (0)