Categorygithub.com/ericaro/frontmatter
modulepackage
0.0.0-20200210094738-46863cd917e2
Repository: https://github.com/ericaro/frontmatter.git
Documentation: pkg.go.dev

# README

Build Status GoDoc

Frontmatter

frontmatter is a golang package that provides a Marshaler/Unmarshaler for frontmatter files.

A frontmatter file is a file with any textual content, and a yaml frontmatter block for metadata, as defined by Jekyll

The frontmatter File must have the following format:

  `---\n`
  <yaml content>
  `\n---\n`
  <text content>

Where, the 'yaml content' is handled by http://gopkg.in/yaml.v2

And where, the text content is 'content' field's value.

The 'content' field must:

  exist
  tagged `fm:"content"`
  be exported
  be of the correct type.

A correct type is:

 - string, *string
 - any convertible to the above two.

see go doc for details.

Installation

first get go then go get github.com/ericaro/frontmatter

This package depends on http://gopkg.in/yaml.v2

License

frontmatter is available under the Apache License, Version 2.0.

Branches

master: Build Status against go versions:

  • 1.3
  • 1.4
  • tip

# Functions

Marshal any object.
Read a String out of a field identified by tag/tagvalue pair.
Unmarshal any object from 'data'.
WriteString set 'txt' on the field tagged with 'tag'.

# Constants

value used to identify the content field.
front matter file header.
front matter metadata/content separator.
Tag used to find the content field.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author