Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONMetadataParser ¶
type JSONMetadataParser struct {
// contains filtered or unexported fields
}
JSONMetadataParser is the MetadataParser for JSON
func (*JSONMetadataParser) Init ¶
func (j *JSONMetadataParser) Init(b *bytes.Buffer) bool
Parse metadata/markdown file
func (*JSONMetadataParser) Markdown ¶
func (j *JSONMetadataParser) Markdown() []byte
func (*JSONMetadataParser) Metadata ¶
func (j *JSONMetadataParser) Metadata() Metadata
Metadata returns parsed metadata. It should be called only after a call to Parse returns without error.
func (*JSONMetadataParser) Type ¶
func (j *JSONMetadataParser) Type() string
type Metadata ¶
type Metadata struct { // Page title Title string // Page template Template string // Publish date Date time.Time // Variables to be used with Template Variables map[string]string // Flags to be used with Template Flags map[string]bool }
Metadata stores a page's metadata
func NewMetadata ¶
NewMetadata() returns a new Metadata struct, loaded with the given map
type MetadataParser ¶
type MetadataParser interface { // Initialize a parser Init(b *bytes.Buffer) bool // Type of metadata Type() string // Parsed metadata. Metadata() Metadata // Raw markdown. Markdown() []byte }
MetadataParser is a an interface that must be satisfied by each parser
func GetParser ¶
func GetParser(buf []byte) MetadataParser
GetParser returns a parser for the given data
type NoneMetadataParser ¶
type NoneMetadataParser struct {
// contains filtered or unexported fields
}
TOMLMetadataParser is the MetadataParser for TOML
func (*NoneMetadataParser) Init ¶
func (n *NoneMetadataParser) Init(b *bytes.Buffer) bool
Parse metadata/markdown file
func (*NoneMetadataParser) Markdown ¶
func (n *NoneMetadataParser) Markdown() []byte
func (*NoneMetadataParser) Metadata ¶
func (n *NoneMetadataParser) Metadata() Metadata
Metadata returns parsed metadata. It should be called only after a call to Parse returns without error.
func (*NoneMetadataParser) Parse ¶
func (n *NoneMetadataParser) Parse(b []byte) ([]byte, error)
Parse the metadata
func (*NoneMetadataParser) Type ¶
func (n *NoneMetadataParser) Type() string
type TOMLMetadataParser ¶
type TOMLMetadataParser struct {
// contains filtered or unexported fields
}
TOMLMetadataParser is the MetadataParser for TOML
func (*TOMLMetadataParser) Init ¶
func (t *TOMLMetadataParser) Init(b *bytes.Buffer) bool
Parse metadata/markdown file
func (*TOMLMetadataParser) Markdown ¶
func (t *TOMLMetadataParser) Markdown() []byte
func (*TOMLMetadataParser) Metadata ¶
func (t *TOMLMetadataParser) Metadata() Metadata
Metadata returns parsed metadata. It should be called only after a call to Parse returns without error.
func (*TOMLMetadataParser) Type ¶
func (t *TOMLMetadataParser) Type() string
type YAMLMetadataParser ¶
type YAMLMetadataParser struct {
// contains filtered or unexported fields
}
YAMLMetadataParser is the MetadataParser for YAML
func (*YAMLMetadataParser) Markdown ¶
func (y *YAMLMetadataParser) Markdown() []byte
func (*YAMLMetadataParser) Metadata ¶
func (y *YAMLMetadataParser) Metadata() Metadata
Metadata returns parsed metadata. It should be called only after a call to Parse returns without error.
func (*YAMLMetadataParser) Type ¶
func (y *YAMLMetadataParser) Type() string