Documentation
¶
Index ¶
- func Blockquote(s string, cols int) string
- func FancyUIWrapText(s string, padding int, secondLineIndent int) string
- func MustRewrap(s string, cols int, pad int) string
- func MustRewrapSense(s string, pad int) string
- func Rewrap(s string, cols, pad int) (string, error)
- func RewrapPad(r io.Reader, w io.Writer, width, pad int) error
- func TerminalWidthWithDefault() int
- type NotATerminalError
- type TermDims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blockquote ¶
func MustRewrapSense ¶
func RewrapPad ¶
RewrapPad reads UTF‑8 text from r, wraps it, and writes it to w. Each line is indented by pad spaces; the total line length (padding + text) never exceeds width.
Paragraphs are separated by blank lines in the input and are preserved.
Example:
err := RewrapPad(os.Stdin, os.Stdout, 80, 4) // 4‑space indent
func TerminalWidthWithDefault ¶
func TerminalWidthWithDefault() int
Types ¶
type NotATerminalError ¶
type NotATerminalError struct{}
func (NotATerminalError) Error ¶
func (e NotATerminalError) Error() string
Click to show internal directories.
Click to hide internal directories.