Skip to content

Commit 46fb950

Browse files
gmarullcarlescufi
authored andcommitted
doc: extensions: kconfig: handle promptless choices showing as parents
Promptless choices can show up as parents when, e.g., people define choices in multiple locations, including modules. Render them using the built-in Kconfig expression to string formatter, so that they show up as '<choice (...)>'. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 63c793a commit 46fb950

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/_extensions/zephyr/kconfig/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,11 @@ def kconfig_build_resources(app: Sphinx) -> None:
337337
iternode = node
338338
while iternode.parent is not iternode.kconfig.top_node:
339339
iternode = iternode.parent
340-
menupath = f" > {iternode.prompt[0]}" + menupath
340+
if iternode.prompt:
341+
title = iternode.prompt[0]
342+
else:
343+
title = kconfiglib.standard_sc_expr_str(iternode.item)
344+
menupath = f" > {title}" + menupath
341345

342346
menupath = "(Top)" + menupath
343347

0 commit comments

Comments
 (0)