add parsers

This commit is contained in:
probandula
2016-11-03 09:23:34 +01:00
parent 76dcd98705
commit 06b018b123
6 changed files with 152 additions and 28 deletions

22
parser.go Normal file
View File

@@ -0,0 +1,22 @@
package figlet4go
// Parser stores some output specific stuff
type Parser struct {
// Name used for switching in colors.go
Name string
// Parser prefix
Prefix string
// Parser suffix
Suffix string
// Newline representation
NewLine string
// Things to be replaced (f.e. \n to <br>)
Replaces map[string]string
}
var (
// Default terminal parser
ParserTerminal Parser = Parser{"terminal", "", "", "\n", nil}
// Parser for HTML code
ParserHTML Parser = Parser{"html", "<code>", "</code>", "<br>", map[string]string{" ": "&nbsp;"}}
)