MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / printStructuredTimelineEntry

Function printStructuredTimelineEntry

cmd/pad/notes.go:164–189  ·  view source on GitHub ↗
(createdAt, createdBy, title, body string)

Source from the content-addressed store, hash-verified

162}
163
164func printStructuredTimelineEntry(createdAt, createdBy, title, body string) {
165 if title == "" {
166 return
167 }
168
169 metaParts := make([]string, 0, 2)
170 if createdAt != "" {
171 if ts, err := time.Parse(time.RFC3339, createdAt); err == nil {
172 metaParts = append(metaParts, cli.RelativeTime(ts))
173 } else {
174 metaParts = append(metaParts, createdAt)
175 }
176 }
177 if createdBy != "" {
178 metaParts = append(metaParts, createdBy)
179 }
180
181 fmt.Printf("• %s", title)
182 if len(metaParts) > 0 {
183 fmt.Printf(" %s", color.New(color.Faint).Sprint(strings.Join(metaParts, " · ")))
184 }
185 fmt.Println()
186 if body != "" {
187 fmt.Printf(" %s\n", body)
188 }
189}

Callers 1

showCmdFunction · 0.85

Calls 2

RelativeTimeFunction · 0.92
JoinMethod · 0.80

Tested by

no test coverage detected