doc: extensions: zephyr-domain: fix object descriptions

Zephyr's domain code-sample object description was incorrectly yielded,
making Sphinx inventory (objects.inv) unusable on other projects that
need to use the domain via Intersphinx.

Ref. https://www.sphinx-doc.org/en/master/extdev/domainapi.html

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2024-01-09 15:23:54 +01:00 committed by Carles Cufí
parent 2ca4ed205f
commit 9f4a7ba0f5

View file

@ -249,7 +249,7 @@ class ZephyrDomain(Domain):
directives = {"code-sample": CodeSampleDirective}
object_types: Dict[str, ObjType] = {
"code-sample": ObjType("code sample", "code-sample"),
"code-sample": ObjType("code-sample", "code-sample"),
}
initial_data: Dict[str, Any] = {"code-samples": {}}
@ -267,9 +267,9 @@ class ZephyrDomain(Domain):
def get_objects(self):
for _, code_sample in self.data["code-samples"].items():
yield (
code_sample["id"],
code_sample["name"],
code_sample["name"],
"code sample",
"code-sample",
code_sample["docname"],
code_sample["id"],
1,