refmt

package module
v0.0.0-...-075936b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2015 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

The refmt package contains extra string utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Underline

func Underline(ulinechar string, format string, v ...interface{}) string

Underline returns a string for an underlined heading

Types

type Style

type Style struct {
	IndentWidth int  // Number of indent characters to prepend
	IndentChar  rune // Character to fill indent space with
	MaxWidth    int  // Maximum width of line (not counting indent)
	SplitChar   rune // usually a newline
	WordSep     rune // usually a space

	// when a word exceeds maxWidth, do we allow a long line to
	// exceed maxwidth or split the word?
	BreakLongWords bool
}

The Wrap object may be used to indent and/or wrap/rewrap strings.

func NewStyle

func NewStyle() *Style

NewWrap returns a new Wrap object preconfigured for a 4 space indent and 76 character lines.

func (Style) Indent

func (s Style) Indent(input string) string

Indent returns an indented version of input

func (Style) Indent2

func (s Style) Indent2(input string) string

Indent2 returns an indented version of input starting with the second line

func (Style) Wrap

func (s Style) Wrap(input string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL