There are quite a few packages to convert Markdown to HTML,
- Pandoc – Supports formats other than Markdown
commonmark-hs – Lightweight parser by the same author of Pandoc
- commonmark-simple – Simpler interface to the above, with frontmatter support
- mmark – Strict Markdown parser
commonmark-simple uses commonmark-hs to provide a simpler API, along with front matter support. If you are parsing front matter, you can use any type that has a
import qualified Commonmark.Simple as CS -- 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)` CS.parseMarkdownWithFrontMatter @Metadata "test.md" "Hello *world*"