defaultMessage
untyped stringdefaultMessage is shown when no message is supplied.
Value
"Moo!"
wrapWidth
untyped bigintwrapWidth is the maximum bubble text width (classic cowsay uses 40).
Value
(40 <untyped> bigint)
Say
func(msg string) stringSay returns the full cowsay art (speech bubble + cow) for msg. An empty msg falls back to the default message.
- OID
- 074259…af4c:3
Say details
balloon
func(lines []string) stringballoon builds the speech bubble around the given (already wrapped) lines.
- OID
- 074259…af4c:5
balloon details
borderChars
func(i int, n int) (string, string)borderChars picks the left/right bubble characters for line i of n. Single line uses \< >. Multi-line uses / \\ for the first row, \\ / for the last row, and | | for the middle rows.
- OID
- 074259…af4c:6
borderChars details
wrap
func(text string, width int) []stringwrap splits text into lines no longer than width, breaking on spaces. Words longer than width are hard-split.
- OID
- 074259…af4c:7
wrap details
maxLen
func(lines []string) intmaxLen returns the length of the longest line.
- OID
- 074259…af4c:8
maxLen details
cow
untyped stringcow is the classic happy cow, aligned under the bubble.
Value
" \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\/\\\n ||----w |\n || ||\n"
Render
func(path string) stringRender displays the cow for gnoweb. Render("") -> default message ("Moo!") Render("/hello there") -> renders "hello there", word-wrapped
- OID
- 074259…af4c:9