Documentation ¶
Overview ¶
Package frontmatter provides a parser for page metadata stored in markdown code blocks.
Index ¶
Constants ¶
View Source
const Fence = "```"
Fence delimits front-matter blocks.
View Source
const SimpleDateLayout = "2006-01-02"
SimpleDateLayout is the time.Time layout used for SimpleDate typed dates that omit a timestamp.
Variables ¶
View Source
var ErrBadFrontMatter = fmt.Errorf("bad front-matter")
ErrBadFrontMatter indicates that the front-matter is incomplete or not decodeable.
View Source
var ErrNoFrontMatter = fmt.Errorf("no front-matter")
ErrNoFrontMatter indicates that the content began without a front-matter.
View Source
var ErrUnsupportedFormat = fmt.Errorf("unsupported format")
ErrUnsupportedFormat indicates that the front-matter uses an unsupported format.
Functions ¶
Types ¶
type SimpleDate ¶
SimpleDate is a basic date format omitting a timestamp.
func NewSimpleDate ¶
func NewSimpleDate(year, month, day int) *SimpleDate
NewSimpleDate returns a SimpleDate for the given date values.
func (*SimpleDate) MarshalJSON ¶
func (s *SimpleDate) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SimpleDate) String ¶
func (s *SimpleDate) String() string
func (*SimpleDate) UnmarshalJSON ¶
func (s *SimpleDate) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.