MCPcopy
hub / github.com/github/awesome-copilot / _load_index

Function _load_index

skills/mini-context-graph/scripts/tools/wiki_store.py:70–91  ·  view source on GitHub ↗

Parse index.md into a list of entry dicts.

()

Source from the content-addressed store, hash-verified

68# ---------------------------------------------------------------------------
69
70def _load_index() -> list[dict]:
71 """Parse index.md into a list of entry dicts."""
72 if not _INDEX_FILE.exists():
73 return []
74 entries = []
75 for line in _INDEX_FILE.read_text().splitlines():
76 # Expected table row: | [[slug]] | category | summary | date |
77 if line.startswith("| [["):
78 parts = [p.strip() for p in line.split("|") if p.strip()]
79 if len(parts) >= 3:
80 link = parts[0] # [[slug]]
81 category = parts[1] if len(parts) > 1 else ""
82 summary = parts[2] if len(parts) > 2 else ""
83 date = parts[3] if len(parts) > 3 else ""
84 slug = re.sub(r"\[\[|\]\]", "", link)
85 entries.append({
86 "slug": slug,
87 "category": category,
88 "summary": summary,
89 "date": date,
90 })
91 return entries
92
93
94def _save_index(entries: list[dict]) -> None:

Callers 3

write_pageFunction · 0.85
list_pagesFunction · 0.85
lint_wikiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected