Documentation
¶
Overview ¶
Package logo prints the brigada logo in a terminal: the banner (the Blackfire flame beside the pixel wordmark), the flame alone and the one-line form from docs/brand/cli, with the flame core in hi-vis orange where the terminal can show it, and the fallbacks docs/brand/README.md sets for no color, no UTF-8 and narrow terminals.
Render is pure: it prints what the given Caps allow. Detect reads the environment and the terminal to fill those Caps.
Index ¶
Constants ¶
const ( // BannerText is cli/banner.txt: the flame and the wordmark, 36 × 5 // characters. Without color the flame core is left blank. BannerText = `` /* 270-byte string literal not displayed */ // MarkText is cli/mark.txt: the flame alone, 7 × 5 characters. MarkText = ` ▄█ ▄ ███ ██▄▀███ ██ ██ ▀█▄▄▄█▀ ` // OneLineText is cli/oneline.txt, for status lines and logs. OneLineText = "▙ brigada\n" // ASCIIText is cli/ascii.txt, for terminals without UTF-8. ASCIIText = `|_ _ . _ _ _| _ |_) | | (_| (_| (_| (_| _| ` )
The texts below are copies of docs/brand/cli/*.txt, byte for byte (a test checks it). go:embed cannot reach docs/ from this package.
const ( BannerWidth = 36 MarkWidth = 7 OneLineWidth = 9 ASCIIWidth = 25 // MinWidth is the narrowest terminal that gets the banner or the mark; // a narrower one gets the one-line form. MinWidth = 37 )
Widths of the texts in terminal columns.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render writes form to w as caps allow:
- without UTF-8, the banner and the mark print as ASCIIText when it fits, and nothing prints otherwise; the one-line form, which has no ASCII version, prints nothing;
- narrower than MinWidth, the banner and the mark print as the one-line form;
- with color, the flame core (coreCells in the banner and the mark) prints on a hi-vis background: the half blocks there keep the terminal's own foreground for the flame body and show orange in their other half, and the blanks turn orange; the ▙ of the one-line form prints in hi-vis; every other cell keeps the default foreground;
- with NoColor, the texts print as they are, the core left blank.
Types ¶
type Caps ¶
type Caps struct {
// TTY is whether the output is a terminal. Render ignores it; callers
// use it to leave the logo out of output that scripts read.
TTY bool
// Color is the color depth; NoColor prints no escape codes.
Color Depth
// UTF8 is false when the locale is not UTF-8 or TERM is dumb.
UTF8 bool
// Width is the terminal width in columns; 0 means unknown.
Width int
}
Caps is what the output can show.