(project_link_map: dict[str, str])
| 1196 | |
| 1197 | |
| 1198 | def copy_existing_docs(project_link_map: dict[str, str]) -> None: |
| 1199 | for source in SOURCE_DOCS.rglob("*.md"): |
| 1200 | if "stylesheets" in source.parts: |
| 1201 | continue |
| 1202 | relative = source.relative_to(SOURCE_DOCS) |
| 1203 | if relative.as_posix() == "index.md": |
| 1204 | continue |
| 1205 | target = TARGET_DOCS / relative |
| 1206 | target.parent.mkdir(parents=True, exist_ok=True) |
| 1207 | body = strip_frontmatter(source.read_text(encoding="utf-8")) |
| 1208 | title = page_title(source, body) |
| 1209 | body = strip_first_h1(body) |
| 1210 | body = rewrite_site_links(body, project_link_map, relative) |
| 1211 | target.write_text(frontmatter(title) + body, encoding="utf-8") |
| 1212 | |
| 1213 | |
| 1214 | def write_catalog_overrides(projects: list[dict]) -> None: |
no test coverage detected