frontmatter

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 4 Imported by: 1

README

frontmatter

Handle frontmatter in files.

example

data, rest, err := frontmatter.Parse(strings.NewReader(`---
name: frontmatter
version: 1.0.0
---

# hello
hello world!`), "---")

/*
data == `name: frontmatter
version: 1.0.0`
*/

/*
rest == `# hello
hello world!`
*/

licence

MIT. More in LICENCE file

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDelimiter = errors.New("frontmatter: missing delimiter")

ErrMissingDelimiter is the error for when a reader does not contain 2 delimiters

Functions

func Parse

func Parse(reader io.Reader, delimiter string) (frontmatter string, rest string, err error)

Parse data into frontmatter and rest

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL