This commit is contained in:
2026-06-07 18:21:10 +07:00
parent dfa0e720ac
commit 696d091efa
3 changed files with 47 additions and 34 deletions

View File

@@ -6,19 +6,30 @@ class MarkdownBuilder:
if not report.tasks:
return "_No tasks updated._"
# Table header
header = "| Category | Task | Status | Progress | Notes |\n"
separator = "| :--- | :--- | :--- | :--- | :--- |\n"
rows = []
for task in report.tasks:
# Format status with some icons if possible, or just plain text
status_text = task.status
if "done" in status_text.lower() or "complete" in status_text.lower():
status_text = f"{status_text}"
elif "progress" in status_text.lower():
status_text = f"🔄 {status_text}"
# Map status to professional badges
status_clean = task.status.lower().strip()
row = f"| {task.category} | {task.task_name} | {status_text} | {task.progress} | {task.notes} |"
if any(x in status_clean for x in ["done", "complete", "finished"]):
badge = "![Done](https://img.shields.io/badge/-DONE-2ea44f?style=flat-square)"
elif any(x in status_clean for x in ["progress", "doing", "active"]):
badge = "![In Progress](https://img.shields.io/badge/-PROGRESS-005cc5?style=flat-square)"
elif any(x in status_clean for x in ["planned", "todo", "waiting"]):
badge = "![Planned](https://img.shields.io/badge/-PLANNED-6a737d?style=flat-square)"
elif any(x in status_clean for x in ["bug", "error", "fix"]):
badge = "![Bug](https://img.shields.io/badge/-FIXING-d73a49?style=flat-square)"
else:
badge = f"`{task.status}`" # Fallback to code text
# Progress bar simulation using HTML/Unicode if needed,
# but simple text "75%" is often cleaner.
row = f"| **{task.category}** | {task.task_name} | {badge} | `{task.progress}` | {task.notes} |"
rows.append(row)
return header + separator + "\n".join(rows)