Documentation ¶
Overview ¶
Package tabbycat is a wrapper around text/tabwriter which ignores the width of any text matching a given regular expression. This can be used to properly tabbify text containing non-printing ANSI terminal control codes, for example. Note that text/tabwriter's ability to filter HTML tags is always enabled since this mechanism is exploited to achieve this package's purpose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer wraps text/tabwriter, ignoring the width of specified text when tabbifying.
func NewWriter ¶
func NewWriter(ignore string, output io.Writer, minWidth, tabWidth, padding int, padChar byte, flags uint) *Writer
NewWriter allocates and initializes a new tabbycat.Writer. The parameters are the same as for the Init function.
func (*Writer) Flush ¶
Flush flushes the underlying tabwriter, extracts ignored text from the HTML comment tags, and writes the result.
func (*Writer) Init ¶
func (w *Writer) Init(ignore string, output io.Writer, minWidth, tabWidth, padding int, padChar byte, flags uint) *Writer
Init initializes a Writer. The ignore parameters is a regular expression that specifies which text to ignore when tabbifying. The other parameters are identical to those of text/tabwriter, with the exception of the FilterHTML flag being always enabled.