Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Wrapper ¶
type Wrapper struct { // Breakpoints defines which characters should be able to break a line. // By default, this follows the usual English rules of spaces, and hyphens. // Default: " -" Breakpoints string // Newline defines which characters should be used to split and create new lines. // Default: "\n" Newline string // OutputLinePrefix is prepended to any output lines. This can be useful // for wrapping code-comments and prefixing new lines with "// ". // Default: "" OutputLinePrefix string // OutputLineSuffix is appended to any output lines. // Default: "" OutputLineSuffix string // LimitIncludesPrefixSuffix can be set to false if you don't want prefixes // and suffixes to be included in the length limits. // Default: true LimitIncludesPrefixSuffix bool // TrimPrefix can be set to remove a prefix on each input line. // This can be paired up with OutputPrefix to create a block of C-style // comments (/* * */ ) from a long single-line comment. // Default: "" TrimInputPrefix string // TrimSuffix can be set to remove a suffix on each input line. // Default: "" TrimInputSuffix string // StripTrailingNewline can be set to true if you want the trailing // newline to be removed from the return value. // Default: false StripTrailingNewline bool // CutLongWords will cause a hard-wrap in the middle of a word if the word's length exceeds the given limit. CutLongWords bool }
Wrapper contains settings for customisable word-wrapping.
func NewWrapper ¶
func NewWrapper() Wrapper
NewWrapper returns a new instance of a Wrapper initialised with defaults.
Click to show internal directories.
Click to hide internal directories.