frontmatter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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