(crate_name: str, crate_dir: Path, html_path: Path)
| 166 | |
| 167 | |
| 168 | def _output_relative(crate_name: str, crate_dir: Path, html_path: Path) -> Path: |
| 169 | crate_slug = _crate_slug(crate_name) |
| 170 | rel = html_path.relative_to(crate_dir) |
| 171 | parent_parts = [_slug_part(part) for part in rel.parent.parts] |
| 172 | if rel.name == "index.html": |
| 173 | return Path(crate_slug, *parent_parts, "index.mdx") |
| 174 | stem = rel.name.removesuffix(".html") |
| 175 | return Path(crate_slug, *parent_parts, f"{_slug_part(stem)}.mdx") |
| 176 | |
| 177 | |
| 178 | def _url_relative(crate_name: str, crate_dir: Path, html_path: Path) -> Path: |
no test coverage detected