MCPcopy Create free account
hub / github.com/driangle/taskmd / toHTMLData

Function toHTMLData

apps/cli/internal/cli/report_html.go:46–97  ·  view source on GitHub ↗
(data *reportData)

Source from the content-addressed store, hash-verified

44}
45
46func toHTMLData(data *reportData) htmlReportData {
47 allTaskMap := buildTaskMapFromGroups(data)
48
49 groups := make([]htmlGroupData, len(data.GroupedTasks.Keys))
50 for i, key := range data.GroupedTasks.Keys {
51 tasks := data.GroupedTasks.Groups[key]
52 htasks := make([]htmlTaskData, len(tasks))
53 for j, t := range tasks {
54 htasks[j] = htmlTaskData{
55 ID: t.ID,
56 Title: t.Title,
57 Status: string(t.Status),
58 Priority: string(t.Priority),
59 }
60 }
61 groups[i] = htmlGroupData{
62 Name: key,
63 Count: len(tasks),
64 Tasks: htasks,
65 }
66 }
67
68 cpTasks := make([]htmlTaskData, len(data.CriticalPath))
69 for i, t := range data.CriticalPath {
70 cpTasks[i] = htmlTaskData{
71 ID: t.ID,
72 Title: t.Title,
73 Status: t.Status,
74 Priority: t.Priority,
75 }
76 }
77
78 blocked := make([]htmlBlockedTaskData, len(data.BlockedTasks))
79 for i, t := range data.BlockedTasks {
80 blocked[i] = htmlBlockedTaskData{
81 ID: t.ID,
82 Title: t.Title,
83 WaitingOn: formatWaitingOn(t.Dependencies, allTaskMap),
84 }
85 }
86
87 return htmlReportData{
88 Metrics: data.Metrics,
89 Groups: groups,
90 GroupByLabel: capitalizeFirst(data.GroupBy),
91 CriticalPath: cpTasks,
92 BlockedTasks: blocked,
93 TypeBreakdown: buildTypeBreakdown(data.Metrics),
94 IncludeGraph: data.IncludeGraph,
95 MermaidSrc: data.GraphMermaid,
96 }
97}
98
99func buildTypeBreakdown(m *metrics.Metrics) []htmlBreakdownItem {
100 typeOrder := []model.TaskType{

Callers 1

outputReportHTMLFunction · 0.85

Calls 4

buildTaskMapFromGroupsFunction · 0.85
formatWaitingOnFunction · 0.85
capitalizeFirstFunction · 0.85
buildTypeBreakdownFunction · 0.85

Tested by

no test coverage detected