fix: resolve semantic documentation deep links
Module Package Release / publish-packages (push) Successful in 12s

This commit is contained in:
2026-08-21 15:54:08 +02:00
parent d6db344d81
commit 7984573c81
2 changed files with 21 additions and 12 deletions
+8 -9
View File
@@ -1083,7 +1083,7 @@ def _semantic_documentation_topics(
"route": route,
"route_anchor": route_anchor,
"help_contexts": [
_semantic_help_context(entry),
_semantic_help_context(entry, route_anchor=route_anchor),
],
},
)
@@ -1091,20 +1091,19 @@ def _semantic_documentation_topics(
return tuple(topics)
def _semantic_help_context(entry: object) -> str:
def _semantic_help_context(
entry: object,
*,
route_anchor: object | None,
) -> str:
values = [
"semantic",
str(getattr(entry, "subject_module_id")),
str(getattr(entry, "subject_kind")),
str(getattr(entry, "subject_id")),
]
if getattr(entry, "anchor_kind", None) and getattr(entry, "anchor_id", None):
values.extend(
(
str(getattr(entry, "anchor_kind")),
str(getattr(entry, "anchor_id")),
)
)
if route_anchor:
values.append(str(route_anchor))
return ".".join(values)