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

Function page_title

tools/build_starlight_content.py:381–387  ·  view source on GitHub ↗
(path: Path, body: str)

Source from the content-addressed store, hash-verified

379
380
381def page_title(path: Path, body: str) -> str:
382 heading = re.search(r"^#\s+(.+)$", body, flags=re.MULTILINE)
383 if heading:
384 return re.sub(r"\s+", " ", heading.group(1)).strip()
385 if path.name == "index.md":
386 return path.parent.name.replace("-", " ").title() or "Home"
387 return path.stem.replace("-", " ").title()
388
389
390def frontmatter(

Callers 1

copy_existing_docsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected