Documentation

Overview

    Package frontmatter implements frontmatter-related functions.

    Index

    Constants

    This section is empty.

    Variables

    View Source
    var ErrNotDetected = errors.New("no frontmatter detected")

      ErrNotDetected is returned when no frontmatter has been detected.

      Functions

      func Contains

      func Contains(text string) (contains bool, err error)

        Contains returns true if the supplied text includes frontmatter.

        func Extract

        func Extract(text string) (frontmatter, content string, err error)

          Extract extracts frontmatter from supplied text, returning frontmatter and content.

          func Parse

          func Parse(text string, obj interface{}) (content string, err error)

            Parse extracts frontmatter from supplied text and unmarshals it into obj, returning content without frontmatter and an error.

            Types

            This section is empty.

            Source Files