doc: boards: extensions: board catalog is only available in HTML

Although boards/index.rst is not included in the PDF toc, it seems as if
Sphinx tries to build the page anyway, which fails because the board
catalog directive is not outputting any node on non-HTML builders.

This commit fixes it by returning a "Board catalog is only available in
HTML." paragraph. In the future, we might want to output some kind of
static table or bullet list for non-HTML builders.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2024-10-17 10:45:03 +02:00 committed by Anas Nashif
commit 239f4308be

View file

@ -586,6 +586,8 @@ class BoardCatalogDirective(SphinxDirective):
renderer = SphinxRenderer([TEMPLATES_DIR]) renderer = SphinxRenderer([TEMPLATES_DIR])
rendered = renderer.render("board-catalog.html", {"catalog": board_catalog}) rendered = renderer.render("board-catalog.html", {"catalog": board_catalog})
return [nodes.raw("", rendered, format="html")] return [nodes.raw("", rendered, format="html")]
else:
return [nodes.paragraph(text="Board catalog is only available in HTML.")]
class ZephyrDomain(Domain): class ZephyrDomain(Domain):