doc: Make search engine configurable

Add UI to select preferred search engine when Google Programmable Search is
enabled. The user's preference is saved using local storage.

This also makes the search input field of type "search" for better UX (in
particular on mobile).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2023-11-07 11:32:08 +01:00 committed by Anas Nashif
commit 7e253ff937
5 changed files with 214 additions and 31 deletions

View file

@ -153,6 +153,9 @@ html_split_index = True
html_show_sourcelink = False
html_show_sphinx = False
html_search_scorer = str(ZEPHYR_BASE / "doc" / "_static" / "js" / "scorer.js")
html_additional_pages = {
"gsearch": "gsearch.html"
}
is_release = tags.has("release") # pylint: disable=undefined-variable
reference_prefix = ""