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

Function _sidebar_title

scripts/docs/generate_rust_library_reference.py:538–550  ·  view source on GitHub ↗
(soup: BeautifulSoup, page: Page)

Source from the content-addressed store, hash-verified

536
537
538def _sidebar_title(soup: BeautifulSoup, page: Page) -> str:
539 topbar = soup.select_one("rustdoc-topbar h2")
540 if topbar is not None:
541 text = _clean_text(topbar.get_text("", strip=True))
542 if text:
543 if text.startswith("Crate "):
544 return page.crate_name
545 if text.startswith("Module "):
546 return text.removeprefix("Module ")
547 return text
548 if page.output_path.name == "index.mdx":
549 return page.output_path.parent.name
550 return page.output_path.stem
551
552
553def _description(soup: BeautifulSoup) -> str:

Callers 1

_render_pageFunction · 0.85

Calls 1

_clean_textFunction · 0.85

Tested by

no test coverage detected