formatPRDTitle converts a kebab-case PRD name to title case.
(name string)
| 460 | |
| 461 | // formatPRDTitle converts a kebab-case PRD name to title case. |
| 462 | func formatPRDTitle(name string) string { |
| 463 | words := strings.Split(name, "-") |
| 464 | for i, w := range words { |
| 465 | if len(w) > 0 { |
| 466 | words[i] = strings.ToUpper(w[:1]) + w[1:] |
| 467 | } |
| 468 | } |
| 469 | return strings.Join(words, " ") |
| 470 | } |
| 471 | |
| 472 | // ansiTruncate returns the first maxWidth visual columns of an ANSI-styled string, |
| 473 | // properly passing through escape sequences without counting them as visible width. |