(pages_by_html: dict[Path, Page], doc_root: Path)
| 604 | |
| 605 | |
| 606 | def _positions(pages_by_html: dict[Path, Page], doc_root: Path) -> dict[Path, int]: |
| 607 | positions: dict[Path, int] = {} |
| 608 | for position, (_crate_name, crate_dir_name, _description) in enumerate(CRATES, start=1): |
| 609 | crate_index = (doc_root / crate_dir_name / "index.html").resolve() |
| 610 | positions[crate_index] = position |
| 611 | |
| 612 | for html_path in pages_by_html: |
| 613 | if html_path.name != "index.html": |
| 614 | continue |
| 615 | for target, position in _item_order(html_path, pages_by_html).items(): |
| 616 | positions[target] = position |
| 617 | |
| 618 | return positions |
| 619 | |
| 620 | |
| 621 | def _write_index(output_dir: Path) -> None: |
no test coverage detected