mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-08-17 18:00:46 +03:00
Fix and generally improve various doc comments
This commit is contained in:
parent
0a77f6374d
commit
514fa059f3
@ -129,7 +129,7 @@ func RoundedBorder() Border {
|
||||
return roundedBorder
|
||||
}
|
||||
|
||||
// Thick border returns a border that's thicker than the one returned by
|
||||
// ThickBorder returns a border that's thicker than the one returned by
|
||||
// NormalBorder.
|
||||
func ThickBorder() Border {
|
||||
return thickBorder
|
||||
|
2
get.go
2
get.go
@ -287,7 +287,7 @@ func (s Style) GetBorderLeftSize() int {
|
||||
return s.getBorderStyle().GetLeftSize()
|
||||
}
|
||||
|
||||
// GetBorderLeftWidth returns the width of the bottom border. If borders
|
||||
// GetBorderBottomSize returns the width of the bottom border. If borders
|
||||
// contain runes of varying widths, the widest rune is returned. If no border
|
||||
// exists on the left edge, 0 is returned.
|
||||
func (s Style) GetBorderBottomSize() int {
|
||||
|
23
set.go
23
set.go
@ -349,31 +349,34 @@ func (s Style) BorderForeground(c ...TerminalColor) Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderTopForegroundColor set the top color of the border.
|
||||
// BorderTopForeground set the foreground color for the top of the border.
|
||||
func (s Style) BorderTopForeground(c TerminalColor) Style {
|
||||
s.set(borderTopForegroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderRightForegroundColor set the top color of the border.
|
||||
// BorderRightForeground sets the foreground color for the right side of the
|
||||
// border.
|
||||
func (s Style) BorderRightForeground(c TerminalColor) Style {
|
||||
s.set(borderRightForegroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderBottomForegroundColor set the top color of the border.
|
||||
// BorderBottomForeground sets the foreground color for the bottom of the
|
||||
// border.
|
||||
func (s Style) BorderBottomForeground(c TerminalColor) Style {
|
||||
s.set(borderBottomForegroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderLeftForegroundColor set the top color of the border.
|
||||
// BorderLeftForeground sets the foreground color for the left side of the
|
||||
// border.
|
||||
func (s Style) BorderLeftForeground(c TerminalColor) Style {
|
||||
s.set(borderLeftForegroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderBackgroundColor is a shorthand function for setting all of the
|
||||
// BorderBackground is a shorthand function for setting all of the
|
||||
// background colors of the borders at once. The arguments work as follows:
|
||||
//
|
||||
// With one argument, the argument is applied to all sides.
|
||||
@ -406,25 +409,27 @@ func (s Style) BorderBackground(c ...TerminalColor) Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderTopBackgroundColor set the top color of the border.
|
||||
// BorderTopBackground sets the background color of the top of the border.
|
||||
func (s Style) BorderTopBackground(c TerminalColor) Style {
|
||||
s.set(borderTopBackgroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderRightBackgroundColor set the top color of the border.
|
||||
// BorderRightBackground sets the background color of right side the border.
|
||||
func (s Style) BorderRightBackground(c TerminalColor) Style {
|
||||
s.set(borderRightBackgroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderBottomBackgroundColor set the top color of the border.
|
||||
// BorderBottomBackground sets the background color of the bottom of the
|
||||
// border.
|
||||
func (s Style) BorderBottomBackground(c TerminalColor) Style {
|
||||
s.set(borderBottomBackgroundKey, c)
|
||||
return s
|
||||
}
|
||||
|
||||
// BorderLeftBackgroundColor set the top color of the border.
|
||||
// BorderLeftBackground set the background color of the left side of the
|
||||
// border.
|
||||
func (s Style) BorderLeftBackground(c TerminalColor) Style {
|
||||
s.set(borderLeftBackgroundKey, c)
|
||||
return s
|
||||
|
2
style.go
2
style.go
@ -97,7 +97,7 @@ func (s Style) SetString(str string) Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// Value returns the raw, unformatted, underlying value for this style.
|
||||
// Value returns the raw, unformatted, underlying string value for this style.
|
||||
func (s Style) Value() string {
|
||||
return s.value
|
||||
}
|
||||
|
6
unset.go
6
unset.go
@ -12,7 +12,7 @@ func (s Style) UnsetItalic() Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// UnsetItalic removes the underline style rule, if set.
|
||||
// UnsetUnderline removes the underline style rule, if set.
|
||||
func (s Style) UnsetUnderline() Style {
|
||||
delete(s.rules, underlineKey)
|
||||
return s
|
||||
@ -229,7 +229,7 @@ func (s Style) UnsetBorderBackground() Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// UnsetBorderTopBackground removes the top border background color rule,
|
||||
// UnsetBorderTopBackgroundColor removes the top border background color rule,
|
||||
// if set.
|
||||
func (s Style) UnsetBorderTopBackgroundColor() Style {
|
||||
delete(s.rules, borderTopBackgroundKey)
|
||||
@ -280,7 +280,7 @@ func (s Style) UnsetUnderlineSpaces() Style {
|
||||
return s
|
||||
}
|
||||
|
||||
// UnsetUnderlineSpaces removes the value set by UnsetStrikethroughSpaces.
|
||||
// UnsetStrikethroughSpaces removes the value set by StrikethroughSpaces.
|
||||
func (s Style) UnsetStrikethroughSpaces() Style {
|
||||
delete(s.rules, strikethroughSpacesKey)
|
||||
return s
|
||||
|
@ -43,7 +43,7 @@ func (w whitespace) render(width int) string {
|
||||
return w.style.Styled(b.String())
|
||||
}
|
||||
|
||||
// WhiteSpaceOption sets a styling rule for rendering whitespace.
|
||||
// WhitespaceOption sets a styling rule for rendering whitespace.
|
||||
type WhitespaceOption func(*whitespace)
|
||||
|
||||
// WithWhitespaceForeground sets the color of the characters in the whitespace.
|
||||
@ -53,7 +53,7 @@ func WithWhitespaceForeground(c TerminalColor) WhitespaceOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithWhiteSpaceBackground sets the background color of the whitespace.
|
||||
// WithWhitespaceBackground sets the background color of the whitespace.
|
||||
func WithWhitespaceBackground(c TerminalColor) WhitespaceOption {
|
||||
return func(w *whitespace) {
|
||||
w.style = w.style.Background(c.color())
|
||||
|
Loading…
Reference in New Issue
Block a user