frontmatter_gen::parser

Function parse

Source
pub fn parse(
    raw_front_matter: &str,
    format: Format,
) -> Result<Frontmatter, Error>
Expand description

Convenience wrapper around parse_with_options using default options.

§Arguments

  • raw_front_matter - A string slice containing the raw front matter content.
  • format - The Format enum specifying the desired format.

§Returns

A Result containing either the parsed Frontmatter object or a Error.

§Errors

Returns an Error if:

  • The format is invalid or unsupported.
  • Parsing fails due to invalid syntax.
  • Validation fails if enabled.