doc: extensions: boards: add search tips admonition

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é <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2024-10-14 09:50:35 +02:00 committed by Henrik Brix Andersen
parent 282a6c5a98
commit ede954c098
2 changed files with 15 additions and 3 deletions

View file

@ -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 <boards-shields>`.
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 <create-your-board-directory>` for adding
support for your own board.
.. toctree::
:maxdepth: 2

View file

@ -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) => {