From 3c2eb6bab68e7bffeb76f0dd2cca23015face253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 14 Oct 2024 09:50:35 +0200 Subject: [PATCH] doc: extensions: boards: add search tips admonition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the search form is becoming richer, provide some guidance on how to filter the list of supported boards and what to do when no results are found. Signed-off-by: Benjamin Cabé --- boards/index.rst | 16 ++++++++++++++-- .../zephyr/domain/static/js/board-catalog.js | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/boards/index.rst b/boards/index.rst index f159f80b80eeadb..0643a355e590d5a 100644 --- a/boards/index.rst +++ b/boards/index.rst @@ -13,8 +13,20 @@ Shields are hardware add-ons that can be stacked on top of a board to add extra functionality. They are listed separately from boards, towards :ref:`the end of this page `. -Use the interactive search form below to quickly navigate through the list of -supported boards. +.. admonition:: Search Tips + :class: dropdown + + * Use the form below to filter the list of supported boards. If a field is left empty, it will + not be used in the filtering process. + + * A board must meet **all** criteria selected across different fields. For example, if you select + both a vendor and an architecture, only boards that match both will be displayed. Within a + single field, selecting multiple options (such as two architectures) will show boards matching + **either** option. + + * Can't find your exact board? Don't worry! If a similar board with the same or a closely related + MCU exists, you can use it as a :ref:`starting point ` for adding + support for your own board. .. toctree:: :maxdepth: 2 diff --git a/doc/_extensions/zephyr/domain/static/js/board-catalog.js b/doc/_extensions/zephyr/domain/static/js/board-catalog.js index 2346156cdee96b9..6ac7ae946b8f5df 100644 --- a/doc/_extensions/zephyr/domain/static/js/board-catalog.js +++ b/doc/_extensions/zephyr/domain/static/js/board-catalog.js @@ -76,7 +76,7 @@ function fillSocSocSelect(families, series = undefined, selectOnFill = false) { families = families?.length ? families : Object.keys(socs_data); series = series?.length ? series : families.flatMap(f => Object.keys(socs_data[f])); - matchingSocs = families.flatMap(f => series.flatMap(s => socs_data[f][s] || [])); + matchingSocs = [...new Set(families.flatMap(f => series.flatMap(s => socs_data[f][s] || [])))]; socSocSelect.innerHTML = ""; matchingSocs.sort().forEach((soc) => {