HTMell-0.1.0.0: Minimal filesystem powered markdown content management system
Copyright(c) 2021-2022 Mirko Westermeier
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

HTMell.Content.Metadata.Frontmatter

Description

A parser for over-simplified frontmatter metadata

Synopsis

Over-simplified frontmatter

Frontmatter usually means a section of YAML data at the beginning of text-based files (like markdown data), surrounded by "---":

---
front: matter
answer: 42
color: blue
---
Rest of the document
...

This parser only understands an oversimplified version, with simple key-value pairs only. For most use cases this should be enough though.

Parsing from strings

readFrontmatter :: String -> Map String String #

Extracts a Map of frontmatter key-value pairs from the given String

splitFrontmatter :: String -> (Map String String, String) #

Splits the given String in a pair of frontmatter data and the rest, without separators.

parseFrontmatter :: ReadS (Map String String) #

The Map parser, useful for debugging.