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

Function parse_index_items

scripts/generate_english_articles.py:258–265  ·  view source on GitHub ↗
(readme_path: Path)

Source from the content-addressed store, hash-verified

256
257
258def parse_index_items(readme_path: Path) -> list[tuple[str, str, str]]:
259 items: list[tuple[str, str, str]] = []
260 pattern = re.compile(r"^\s*-\s*(\d{4}-\d{2}-\d{2})\s*-\s*\[([^\]]+)]\(([^)]+)\)")
261 for line in readme_path.read_text(encoding="utf-8").splitlines():
262 match = pattern.match(line)
263 if match:
264 items.append((match.group(1), match.group(2), match.group(3)))
265 return items
266
267
268def main() -> None:

Callers 2

write_indexesFunction · 0.85
write_category_indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected