frontmatter

package
v1.76.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package frontmatter provides a way of reading or writing Markdown or HTML files with a prepended frontmatter header in YAML or Protobuf Text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(w io.Writer, data interface{}, content string) error

Marshal writes a frontmatter file with data in the header and content in the body. If data is a proto.Message it will use Protobuf Text, otherwise it will use a simple YAML serialization.

func Unmarshal

func Unmarshal(rd io.Reader, data interface{}) (string, error)

Unmarshal reads the input and parses the frontmatter into data returning the content. If data is a proto.Message it will use Protobuf Text, otherwise it will use YAML to read it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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