MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / _linked_signature_html

Function _linked_signature_html

scripts/docs/generate_rust_library_reference.py:303–322  ·  view source on GitHub ↗
(node: PageElement, page: Page, pages_by_html: dict[Path, Page])

Source from the content-addressed store, hash-verified

301
302
303def _linked_signature_html(node: PageElement, page: Page, pages_by_html: dict[Path, Page]) -> str:
304 if isinstance(node, NavigableString):
305 return _html_text(str(node))
306 if not isinstance(node, Tag):
307 return ""
308
309 classes = _tag_classes(node)
310 if classes & {"anchor", "doc-anchor", "src"} or node.name in {"script", "style", "wbr", "button"}:
311 return ""
312 if node.name == "br":
313 return "\n"
314 if node.name == "a":
315 label = "".join(_linked_signature_html(child, page, pages_by_html) for child in node.children)
316 if not label:
317 return ""
318 target = _signature_link_target(page, _tag_href(node), pages_by_html)
319 if target is None:
320 return label
321 return f'<a href="{_html_attr(target)}">{label}</a>'
322 return "".join(_linked_signature_html(child, page, pages_by_html) for child in node.children)
323
324
325def _linked_signature_block(node: Tag, page: Page, pages_by_html: dict[Path, Page]) -> str:

Callers 1

_linked_signature_blockFunction · 0.85

Calls 6

_html_textFunction · 0.85
_tag_classesFunction · 0.85
_signature_link_targetFunction · 0.85
_tag_hrefFunction · 0.85
_html_attrFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected