func parsers() []Parser {
	return []Parser{
		&TOMLParser{},
		&YAMLParser{},
		&JSONParser{},
		&NoneParser{},
	}
}
parsers returns all available parsers
package metadata
import (
	"bufio"
	"bytes"
	"time"
)
var (
	timeLayout = []string{
		`2006-01-02 15:04:05-0700`,
		`2006-01-02 15:04:05`,
		`2006-01-02`,
	}
)
type Metadata struct {
	Title string
	Template string
	Date time.Time
	Variables map[string]interface{}
}
func NewMetadata(parsedMap map[string]interface{}) Metadata {
	md := Metadata{
		Variables: make(map[string]interface{}),
	}
	md.load(parsedMap)
	return md
}
func (m *Metadata) load(parsedMap map[string]interface{}) {
	if title, ok := parsedMap["title"]; ok {
		m.Title, _ = title.(string)
	}
	if template, ok := parsedMap["template"]; ok {
		m.Template, _ = template.(string)
	}
	if date, ok := parsedMap["date"].(string); ok {
		for _, layout := range timeLayout {
			if t, err := time.Parse(layout, date); err == nil {
				m.Date = t
				break
			}
		}
	}
	m.Variables = parsedMap
}
type Parser interface {
	Init(b *bytes.Buffer) bool
	Type() string
	Metadata() Metadata
	Markdown() []byte
}
func GetParser(buf []byte) Parser {
	for _, p := range parsers() {
		b := bytes.NewBuffer(buf)
		if p.Init(b) {
			return p
		}
	}
	return nil
}