MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _render_topic_index

Function _render_topic_index

agents/wiki-agent/export/monthly_report.py:308–326  ·  view source on GitHub ↗
(user_id: str, month: str, rows: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

306
307
308def _render_topic_index(user_id: str, month: str, rows: List[Dict[str, Any]]) -> str:
309 topic_groups = _build_topic_groups(rows)
310 lines = [
311 f"# Topic Index - {month}",
312 "",
313 f"用户:`{user_id}`",
314 "",
315 ]
316 if not topic_groups:
317 lines.append("暂无可索引主题。")
318 lines.append("")
319 return "\n".join(lines)
320 for topic, items in topic_groups.items():
321 lines.extend([f"## {topic}", ""])
322 for item in items:
323 link = item["links"] or item["title"]
324 lines.append(f"- {item['date']} · {link} · {item['title']}")
325 lines.append("")
326 return "\n".join(lines)
327
328
329def export_monthly_report(

Callers 1

export_monthly_reportFunction · 0.85

Calls 1

_build_topic_groupsFunction · 0.85

Tested by

no test coverage detected