Files
nib-v1/internal/display/glyph.go
T
lerko c3cc9464b9 feat(cli): add promote, cards, copy, demote, delete, edit commands
Complete CLI crystallization loop. Promote generates card_data
(template slots, checklist steps, link URLs). Cards view sorted by
use_count. Copy increments usage. Demote strips card layer. Delete
does soft then hard. Edit opens $EDITOR.
2026-05-14 11:28:17 -04:00

37 lines
648 B
Go

package display
import "github.com/lerko/nib/internal/db"
var glyphMap = map[db.Glyph]string{
db.GlyphNote: "◦",
db.GlyphTodo: "▸",
db.GlyphEvent: "◇",
}
var cardGlyphMap = map[db.CardType]string{
db.CardSnippet: "◆",
db.CardTemplate: "◈",
db.CardChecklist: "☐",
db.CardDecision: "⚖",
db.CardLink: "🔗",
}
func DisplayGlyph(glyph db.Glyph, cardType *db.CardType) string {
if cardType != nil {
if g, ok := cardGlyphMap[*cardType]; ok {
return g
}
}
if g, ok := glyphMap[glyph]; ok {
return g
}
return "◦"
}
func FormatID(id string) string {
if len(id) > 12 {
return id[:12]
}
return id
}