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

Function _remove_noisy_sections

scripts/docs/generate_rust_library_reference.py:477–498  ·  view source on GitHub ↗
(content: Tag)

Source from the content-addressed store, hash-verified

475
476
477def _remove_noisy_sections(content: Tag) -> None:
478 for selector in [
479 "script",
480 "style",
481 "rustdoc-toolbar",
482 ".src",
483 "button",
484 ".item-info",
485 "#notable-traits-data",
486 ]:
487 for element in content.select(selector):
488 element.decompose()
489
490 for section_id in ("synthetic-implementations", "blanket-implementations"):
491 heading = content.find(id=section_id)
492 if heading is None:
493 continue
494 for sibling in list(heading.find_next_siblings()):
495 if isinstance(sibling, Tag) and sibling.name == "h2":
496 break
497 sibling.decompose()
498 heading.decompose()
499
500
501def _page_title(soup: BeautifulSoup, page: Page) -> str:

Callers 1

_render_pageFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected