Commit 258b89bd authored by Benjamin Cabé's avatar Benjamin Cabé Committed by Benjamin Cabé
Browse files

doc: _extensions: handle custom bindings in board catalog

Boards might have local bindings for which generating links using the
dtcompatible role doesn't work -- update the code accordingly so that
we can still provide a description of these custom bindings in the table
of supported features (but with no hyperlink).

Signed-off-by: default avatarBenjamin Cabé <benjamin@zephyrproject.org>
parent d6d0c1c4
Loading
Loading
Loading
Loading
+1 −1
Changes for doc/_extensions/zephyr/domain/__init__.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -955,7 +955,7 @@ class BoardSupportedHardwareDirective(SphinxDirective):
                        reftype="dtcompatible",
                        reftarget=key,
                        refexplicit=False,
                        refwarn=True,
                        refwarn=(not value.get("custom_binding", False)),
                    )
                    xref += nodes.literal(text=key)
                    compatible_entry += nodes.paragraph("", "", xref)
+8 −5
Changes for doc/_scripts/gen_boards_catalog.py: 8 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -254,11 +254,13 @@ def get_catalog(generate_hw_features=False):
                        continue

                    binding_path = Path(node.binding_path)
                    binding_type = (
                        binding_path.relative_to(ZEPHYR_BINDINGS).parts[0]
                        if binding_path.is_relative_to(ZEPHYR_BINDINGS)
                        else "misc"
                    )
                    is_custom_binding = False
                    if binding_path.is_relative_to(ZEPHYR_BINDINGS):
                        binding_type = binding_path.relative_to(ZEPHYR_BINDINGS).parts[0]
                    else:
                        binding_type = "misc"
                        is_custom_binding = True


                    if node.matching_compat is None:
                        continue
@@ -292,6 +294,7 @@ def get_catalog(generate_hw_features=False):

                    feature_data = {
                        "description": description,
                        "custom_binding": is_custom_binding,
                        "locations": locations,
                        "okay_nodes": [],
                        "disabled_nodes": [],