| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Commonmark.Simple
Description
A simple interface to the commonmark package for parsing real-world Markdown
Where 'real-world' means the kind of syntax used in the likes of Obsidian Markdown.
Synopsis
- parseMarkdownWithFrontMatter :: forall meta (m :: Type -> Type) il bl. (FromJSON meta, m ~ Either ParseError, bl ~ Cm () Blocks, il ~ Cm () Inlines) => SyntaxSpec m il bl -> FilePath -> Text -> Either Text (Maybe meta, Pandoc)
- parseMarkdown :: FilePath -> Text -> Either Text Pandoc
- fullMarkdownSpec :: forall (m :: Type -> Type) il bl. SyntaxSpec' m il bl => SyntaxSpec m il bl
Documentation
parseMarkdownWithFrontMatter Source #
Arguments
| :: forall meta (m :: Type -> Type) il bl. (FromJSON meta, m ~ Either ParseError, bl ~ Cm () Blocks, il ~ Cm () Inlines) | |
| => SyntaxSpec m il bl | |
| -> FilePath | Path to file associated with this Markdown |
| -> Text | Markdown text to parse |
| -> Either Text (Maybe meta, Pandoc) |
Like parseMarkdown but also parses the YAML frontmatter
parseMarkdown :: FilePath -> Text -> Either Text Pandoc Source #
Parse a Markdown file using commonmark-hs with all extensions enabled
fullMarkdownSpec :: forall (m :: Type -> Type) il bl. SyntaxSpec' m il bl => SyntaxSpec m il bl Source #
GFM + official commonmark extensions