Skip to content

Commit

Permalink
doc: extensions: boards: add search tips admonition
Browse files Browse the repository at this point in the history
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é <[email protected]>
  • Loading branch information
kartben committed Oct 14, 2024
1 parent 7f081f7 commit 3c2eb6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions boards/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/_extensions/zephyr/domain/static/js/board-catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 3c2eb6b

Please sign in to comment.