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 <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-05-02 09:18:22 +02:00 committed by Carles Cufí
commit 46fb9509bf

View file

@ -337,7 +337,11 @@ def kconfig_build_resources(app: Sphinx) -> None:
iternode = node
while iternode.parent is not iternode.kconfig.top_node:
iternode = iternode.parent
menupath = f" > {iternode.prompt[0]}" + menupath
if iternode.prompt:
title = iternode.prompt[0]
else:
title = kconfiglib.standard_sc_expr_str(iternode.item)
menupath = f" > {title}" + menupath
menupath = "(Top)" + menupath