Documentation ¶
Overview ¶
Package simple implements a Transformer that supports basic replacement based transformations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { ReplaceMap struct { Bold string Italic string Underline string Strikethrough string Reset string } `xml:"replace_map" comment:"Replace the listed formatting codes with the given string"` ColourMap []struct { R uint8 `toml:"red"` G uint8 `toml:"green"` B uint8 `toml:"blue"` Mapped string } `toml:"map_colour" comment:"maps the given RGB colour to a string"` }
Conf Holds a replacemap and a colourmap in a format that's simple to store in XML
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer is a Transformer implementation that does basic replacement based transformation. Colours are handled by way of a palette and a map to transform colours in that palette to the transformer specific format
func New ¶
New constructs a Transformer from the given args. A colour palette will be automatically created from the colour map passed.
func (*Transformer) MakeIntermediate ¶
func (s *Transformer) MakeIntermediate(in string) string
MakeIntermediate uses a simple replace operation to convert from a transformer specific implementation to the intermediate format
func (*Transformer) Transform ¶
func (s *Transformer) Transform(in string) string
Transform implements the Transformer interface. Applies the simple conversions setup in the constructor