There are quite a few packages to convert Markdown to HTML,
Ema provides a helper to parse Markdown files with YAML frontmatter, using commonmark-hs. If you are parsing front matter, you can use any type that has a
import qualified Ema.Helper.Markdown as Markdown -- Front matter metadata can be any type with a `FromYAML` instance -- -- Using a `Map` is a lazy way to capture metadata, but in real code we -- generally define a sum type and manually derive `FromYAML` for it. type Metadata = Map Text Text -- Returns `Either Text (Metadata, Pandoc)` Markdown.parseMarkdownWithFrontMatter @Metadata "test.md" "Hello *world*"
This very site uses this helper to parse Markdown files into Pandoc AST. Furthermore it provides its own renderer of the Pandoc AST, to be able to customize the CSS styling of individual AST nodes. Consult the source code for details.