fix: resolve semantic documentation deep links
Module Package Release / publish-packages (push) Successful in 12s
Module Package Release / publish-packages (push) Successful in 12s
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user