facet

Types

The Entire Document split between frontmatter and content.

pub type Document {
  Document(frontmatter: Option(Frontmatter), content: String)
}

Constructors

  • Document(frontmatter: Option(Frontmatter), content: String)
pub type Error {
  Empty
  ParseError(msg: String)
}

Constructors

  • Empty
  • ParseError(msg: String)

The frontmatter content with format-specific variants.

pub type Frontmatter {
  TOML(content: String)
  JSON(content: String)
  YAML(content: String)
}

Constructors

  • TOML(content: String)
  • JSON(content: String)
  • YAML(content: String)

Functions

pub fn parse(in: String) -> Result(Document, Error)

Parse an input string and grab the frontmatter if it exists.

Search Document