| 475 | |
| 476 | |
| 477 | def _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 | |
| 501 | def _page_title(soup: BeautifulSoup, page: Page) -> str: |