MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / _entry_row

Function _entry_row

scripts/generate_docs_index.py:404–421  ·  view source on GitHub ↗

Format a table row for a document entry.

(entry: dict, repo_root: Path)

Source from the content-addressed store, hash-verified

402
403
404def _entry_row(entry: dict, repo_root: Path) -> str:
405 """Format a table row for a document entry."""
406 title = entry["title_zh"]
407 doc_num = entry.get("doc_number", "")
408 # Support both effective_date (docs) and published_date (insights)
409 date_raw = entry.get("effective_date", "") or entry.get("published_date", "")
410 date = date_raw[:4] if date_raw else ""
411
412 # Internal VitePress route (synced to docs/zh/<section_key>/<slug>)
413 section_key = entry.get("category", "")
414 slug = unquote(entry["slug"])
415 link = f"/zh/{section_key}/{slug}"
416
417 title_cell = f"[{title}]({link})"
418 doc_num_cell = f"`{doc_num}`" if doc_num else ""
419 date_cell = date
420
421 return f"| {title_cell} | {doc_num_cell} | {date_cell} |"
422
423
424def get_en_entries(entries: List[dict], repo_root: Path) -> List[dict]:

Callers 1

generate_section_pageFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected