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

Function formatHeading

apps/cli/internal/cli/colors.go:122–137  ·  view source on GitHub ↗

formatHeading colors a heading based on the group-by field and key value.

(key, groupBy string, r *lipgloss.Renderer)

Source from the content-addressed store, hash-verified

120
121// formatHeading colors a heading based on the group-by field and key value.
122func formatHeading(key, groupBy string, r *lipgloss.Renderer) string {
123 var style lipgloss.Style
124 switch groupBy {
125 case "status":
126 style = getStatusColor(key, r)
127 case "priority":
128 style = getPriorityColor(key, r)
129 case "effort":
130 style = getEffortColor(key, r)
131 case "type":
132 style = getTypeColor(key, r)
133 default:
134 style = r.NewStyle().Bold(true)
135 }
136 return style.Render(key)
137}
138
139// formatStatus formats status text with status-based color.
140func formatStatus(status string, r *lipgloss.Renderer) string {

Callers 4

writeMarkdownGroupsFunction · 0.85
outputBoardMarkdownFunction · 0.85
outputBoardTextFunction · 0.85
TestFormatHeading_EffortFunction · 0.85

Calls 4

getStatusColorFunction · 0.85
getPriorityColorFunction · 0.85
getEffortColorFunction · 0.85
getTypeColorFunction · 0.85

Tested by 1

TestFormatHeading_EffortFunction · 0.68