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

Function renderTaskFile

apps/cli/internal/sync/writer.go:53–78  ·  view source on GitHub ↗
(id string, mapped MappedTask, externalID, sourceName string)

Source from the content-addressed store, hash-verified

51}
52
53func renderTaskFile(id string, mapped MappedTask, externalID, sourceName string) string {
54 var b strings.Builder
55 b.WriteString("---\n")
56 fmt.Fprintf(&b, "id: %q\n", id)
57 fmt.Fprintf(&b, "title: %q\n", mapped.Title)
58 fmt.Fprintf(&b, "status: %s\n", mapped.Status)
59 if mapped.Priority != "" {
60 fmt.Fprintf(&b, "priority: %s\n", mapped.Priority)
61 }
62 if mapped.Owner != "" {
63 fmt.Fprintf(&b, "owner: %s\n", mapped.Owner)
64 }
65 b.WriteString("dependencies: []\n")
66 b.WriteString(taskfile.FormatInlineTags(mapped.Tags) + "\n")
67 fmt.Fprintf(&b, "sync_source: %s\n", sourceName)
68 fmt.Fprintf(&b, "external_id: %q\n", externalID)
69 b.WriteString("---\n")
70
71 if mapped.Description != "" {
72 b.WriteString("\n")
73 b.WriteString(mapped.Description)
74 b.WriteString("\n")
75 }
76
77 return b.String()
78}

Callers 1

WriteTaskFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected