Skip to content

Commit 258b89b

Browse files
committed
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: Benjamin Cabé <[email protected]>
1 parent d6d0c1c commit 258b89b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

doc/_extensions/zephyr/domain/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ def create_count_indicator(nodes_list, class_type, role_function=role_fn):
955955
reftype="dtcompatible",
956956
reftarget=key,
957957
refexplicit=False,
958-
refwarn=True,
958+
refwarn=(not value.get("custom_binding", False)),
959959
)
960960
xref += nodes.literal(text=key)
961961
compatible_entry += nodes.paragraph("", "", xref)

doc/_scripts/gen_boards_catalog.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,13 @@ def get_catalog(generate_hw_features=False):
254254
continue
255255

256256
binding_path = Path(node.binding_path)
257-
binding_type = (
258-
binding_path.relative_to(ZEPHYR_BINDINGS).parts[0]
259-
if binding_path.is_relative_to(ZEPHYR_BINDINGS)
260-
else "misc"
261-
)
257+
is_custom_binding = False
258+
if binding_path.is_relative_to(ZEPHYR_BINDINGS):
259+
binding_type = binding_path.relative_to(ZEPHYR_BINDINGS).parts[0]
260+
else:
261+
binding_type = "misc"
262+
is_custom_binding = True
263+
262264

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

293295
feature_data = {
294296
"description": description,
297+
"custom_binding": is_custom_binding,
295298
"locations": locations,
296299
"okay_nodes": [],
297300
"disabled_nodes": [],

0 commit comments

Comments
 (0)