yesod-markdown-0.4.0: Tools for using markdown in a yesod application

Safe HaskellNone

Yesod.Markdown

Contents

Description

Rewrite/simplification of yesod-markdown written by ajdunlap.

Forked from https://github.com/ajdunlap/yesod-markdown.

Synopsis

Documentation

Wrappers

markdownToHtml :: Markdown -> HtmlSource

Converts markdown directly to html using the yesod default option sets and sanitization.

markdownToHtmlTrusted :: Markdown -> HtmlSource

Same but with no sanitization run

markdownFromFile :: FilePath -> IO MarkdownSource

Reads markdown in from the specified file; returns the empty string if the file does not exist

Conversions

parseMarkdown :: ParserState -> Markdown -> PandocSource

Parses Markdown into the intermediate Pandoc type

writePandoc :: WriterOptions -> Pandoc -> HtmlSource

Converts the intermediate Pandoc type to Html. Sanitizes HTML.

writePandocTrusted :: WriterOptions -> Pandoc -> HtmlSource

Skips the sanitization and its required conversion to Text

Option sets

yesodDefaultWriterOptions :: WriterOptionsSource

Pandoc defaults, plus Html5, minus WrapText

yesodDefaultParserState :: ParserStateSource

Pandoc defaults, plus Smart, plus ParseRaw

Form helper