Files
BABA_YAGA/BABA_YAGA_Updater/mappers/markdown_builder.py
2026-06-07 17:48:09 +07:00

25 lines
963 B
Python

from core.models import ProgressReport
class MarkdownBuilder:
@staticmethod
def build_table(report: ProgressReport) -> str:
if not report.tasks:
return "_No tasks updated._"
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}"
row = f"| {task.category} | {task.task_name} | {status_text} | {task.progress} | {task.notes} |"
rows.append(row)
return header + separator + "\n".join(rows)