doc: samples: Show related code samples contents by default

Add required class so that sphinx-togglebutton admonition is expanded by
default.

Also remove sphinx-immaterial code that should not be there.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2023-10-27 11:03:54 +02:00 committed by Carles Cufí
parent cf1fdc3ea8
commit 26d7c61370

View file

@ -154,9 +154,10 @@ class ProcessRelatedCodeSamplesNode(SphinxPostTransform):
if len(code_samples) > 0:
admonition = nodes.admonition()
admonition += nodes.title(text="Related code samples")
admonition["collapsible"] = "" # used by sphinx-immaterial theme
admonition["classes"].append("related-code-samples")
admonition["classes"].append("dropdown") # used by sphinx-togglebutton extension
admonition["classes"].append("toggle-shown") # show the content by default
sample_dl = nodes.definition_list()
for code_sample in sorted(code_samples, key=lambda x: x["name"]):