MCPcopy Create free account
hub / github.com/DevCloudNinjas/DevOps-Projects / copy_existing_docs

Function copy_existing_docs

tools/build_starlight_content.py:1198–1211  ·  view source on GitHub ↗
(project_link_map: dict[str, str])

Source from the content-addressed store, hash-verified

1196
1197
1198def 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
1214def write_catalog_overrides(projects: list[dict]) -> None:

Callers 1

mainFunction · 0.85

Calls 5

strip_frontmatterFunction · 0.85
page_titleFunction · 0.85
strip_first_h1Function · 0.85
rewrite_site_linksFunction · 0.85
frontmatterFunction · 0.85

Tested by

no test coverage detected