Documentation
ยถ
Index ยถ
Constants ยถ
const ( DefaultIcon = "weights" DefaultColor = "blue" )
Variables ยถ
var ( // IconValues lists the icon names HEY accepts for habits. IconValues = iconNames() // ColorValues lists the color names HEY accepts for habits. ColorValues = strings.Join(Colors, ", ") )
var Colors = []string{"blue", "red", "gold", "green", "teal", "purple", "pink", "brown"}
Colors are the habit colors HEY accepts, in the order its own enum declares them.
var EveryDay = []int32{0, 1, 2, 3, 4, 5, 6}
var Icons = []Icon{
{"weights", "๐ช"}, {"art", "๐จ"}, {"baseball", "โพ"}, {"basketball", "๐"},
{"bed", "๐ด"}, {"bicycle", "๐ฒ"}, {"brain", "๐ง "}, {"camera", "๐ท"},
{"cat", "๐ฑ"}, {"church", "โช"}, {"clean", "๐งน"}, {"cook", "๐ณ"},
{"dog", "๐ถ"}, {"football", "๐"}, {"fruit", "๐"}, {"game", "๐ฎ"},
{"garden", "๐ป"}, {"guitar", "๐ธ"}, {"heart", "๐"}, {"hydrate", "๐ง"},
{"meditate", "๐ง"}, {"money", "๐ฐ"}, {"music", "๐ต"}, {"piano", "๐น"},
{"pill", "๐"}, {"plant", "๐ฑ"}, {"read", "๐"}, {"run", "๐"},
{"smoke", "๐ฌ"}, {"soccer", "โฝ"}, {"study", "๐"}, {"swim", "๐"},
{"tea", "๐ต"}, {"toothbrush", "๐ชฅ"}, {"tree", "๐ณ"}, {"tv", "๐บ"},
{"vegetable", "๐ฅ"}, {"walk", "๐ถ"}, {"water", "๐ฐ"}, {"write", "๐"},
{"yoga", "๐คธ"}, {"heat", "๐ฅ"}, {"ice", "๐ง"}, {"lotus", "๐ธ"},
{"breathe", "๐จ"}, {"drink", "๐ฅค"}, {"star", "โญ"},
}
Icons are the habit icons HEY accepts, in the order its own enum declares them.
Functions ยถ
func EmojiFor ยถ
EmojiFor answers the emoji standing in for an icon, and nothing for a name HEY does not know, so a habit carrying an icon this build has not heard of still lists.
func FormatDays ยถ
FormatDays returns weekdays in the numeric form accepted by HEY.
func ParseDays ยถ
ParseDays accepts comma-separated weekday names or numbers from Sunday (0) through Saturday (6).
func ValidateColor ยถ
ValidateColor accepts a color name supported by HEY habits.
func ValidateIcon ยถ
ValidateIcon accepts an icon name supported by HEY habits.
Types ยถ
type Icon ยถ
Icon is one of the icons HEY draws a habit with. HEY serves an SVG per icon, which a terminal cannot draw, so each carries the emoji that stands in for it. The emoji are all two cells wide โ see TestEveryHabitEmojiIsTwoCellsWide โ because a habit's icon sits in lists whose width is measured.