Format a table row for a document entry.
(entry: dict, repo_root: Path)
| 402 | |
| 403 | |
| 404 | def _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 | |
| 424 | def get_en_entries(entries: List[dict], repo_root: Path) -> List[dict]: |
no test coverage detected