MCPcopy Create free account
hub / github.com/crisxuan/bestJavaer / title_from_markdown

Function title_from_markdown

scripts/generate_english_articles.py:117–122  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

115
116
117def title_from_markdown(path: Path) -> str:
118 for line in path.read_text(encoding="utf-8").splitlines():
119 match = re.match(r"^#\s+(.+?)\s*$", line)
120 if match:
121 return match.group(1).strip()
122 return path.stem
123
124
125def english_title(title: str) -> str:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected