frontmatter

package
v0.0.0-...-5fd8514 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRune

func AppendRune(frontmatter []byte, mark rune) []byte

AppendRune appends the frontmatter rune to a file

func HasRune

func HasRune(file []byte) bool

HasRune checks if the file has the frontmatter rune

func Marshal

func Marshal(data interface{}, mark rune) ([]byte, error)

Marshal encodes the interface in a specific format

func RuneToStringFormat

func RuneToStringFormat(mark rune) (string, error)

RuneToStringFormat converts the rune to a string with the format

func StringFormatToRune

func StringFormatToRune(format string) (rune, error)

StringFormatToRune converts the format name to its rune

func Unmarshal

func Unmarshal(content []byte) (interface{}, error)

Unmarshal returns the data of the frontmatter

Types

type Block

type Block struct {
	Name     string
	Title    string
	Type     string
	HTMLType string
	Content  *Content
	Parent   *Block
}

Block is a block

type Content

type Content struct {
	Other   interface{}
	Fields  []*Block
	Arrays  []*Block
	Objects []*Block
}

Content is the block content

func Pretty

func Pretty(content []byte) (*Content, string, error)

Pretty creates a new FrontMatter object

Jump to

Keyboard shortcuts

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