From 514fa059f3e403ac01c4398e798854ec63cc4009 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 14 Feb 2022 11:39:57 -0500 Subject: [PATCH] Fix and generally improve various doc comments --- borders.go | 2 +- get.go | 2 +- set.go | 23 ++++++++++++++--------- style.go | 2 +- unset.go | 6 +++--- whitespace.go | 4 ++-- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/borders.go b/borders.go index 608f443..a3284ac 100644 --- a/borders.go +++ b/borders.go @@ -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 diff --git a/get.go b/get.go index 4368bc3..8790622 100644 --- a/get.go +++ b/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 { diff --git a/set.go b/set.go index 66b3114..2e7dfc8 100644 --- a/set.go +++ b/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 diff --git a/style.go b/style.go index f664fba..a3a5e4a 100644 --- a/style.go +++ b/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 } diff --git a/unset.go b/unset.go index 0b42071..0a03720 100644 --- a/unset.go +++ b/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 diff --git a/whitespace.go b/whitespace.go index 624ffc1..6c510a7 100644 --- a/whitespace.go +++ b/whitespace.go @@ -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())