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

Function _resolve_href

scripts/docs/generate_rust_library_reference.py:224–236  ·  view source on GitHub ↗
(page: Page, href: str, pages_by_html: dict[Path, Page])

Source from the content-addressed store, hash-verified

222
223
224def _resolve_href(page: Page, href: str, pages_by_html: dict[Path, Page]) -> str | None:
225 if not href or href.startswith("#"):
226 return None
227 if href.startswith(("http://", "https://")):
228 return href
229 href_no_fragment, _fragment = urldefrag(href)
230 if href_no_fragment.startswith("../src/") or "/src/" in href_no_fragment:
231 return None
232 target = (page.html_path.parent / href_no_fragment).resolve()
233 target_page = pages_by_html.get(target)
234 if target_page is None:
235 return None
236 return target_page.url
237
238
239def _tag_classes(node: Tag) -> set[str]:

Callers 2

_inline_markdownFunction · 0.85
_signature_link_targetFunction · 0.85

Calls 2

resolveMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected