Skip to content

Commit

Permalink
Docs: update Sphinx instructions to override search (#11702)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
stsewd authored Oct 28, 2024
1 parent f4b6ae7 commit ad74e78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/user/intro/sphinx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ If you're using a different theme, enable :doc:`Server side search </server-side
// Trigger the Read the Docs Addons Search modal when clicking on "Search docs" input from the topnav.
// NOTE: The selector of the search input may need to be adjusted based on your theme.
document.querySelector("[role='search'] input").addEventListener("focusin", () => {
const event = new CustomEvent("readthedocs-search-show");
document.dispatchEvent(event);
Expand All @@ -97,7 +98,7 @@ If you're using a different theme, enable :doc:`Server side search </server-side
:caption: conf.py
html_js_files = [
"readthedocs.js",
("readthedocs.js", {"defer": "defer"}),
]
Expand Down

0 comments on commit ad74e78

Please sign in to comment.