Safe Haskell | None |
---|---|
Language | Haskell98 |
Rewrite/simplification of yesod-markdown written by ajdunlap.
Forked from https://github.com/ajdunlap/yesod-markdown.
- newtype Markdown = Markdown {
- unMarkdown :: Text
- markdownToHtml :: Markdown -> Either PandocError Html
- markdownToHtmlTrusted :: Markdown -> Either PandocError Html
- markdownFromFile :: FilePath -> IO Markdown
- parseMarkdown :: ReaderOptions -> Markdown -> Either PandocError Pandoc
- writePandoc :: WriterOptions -> Pandoc -> Html
- writePandocTrusted :: WriterOptions -> Pandoc -> Html
- yesodDefaultWriterOptions :: WriterOptions
- yesodDefaultReaderOptions :: ReaderOptions
- markdownField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Markdown
Documentation
Wrappers
markdownToHtmlTrusted :: Markdown -> Either PandocError Html Source #
No HTML sanitization
markdownFromFile :: FilePath -> IO Markdown Source #
Returns the empty string if the file does not exist
Conversions
parseMarkdown :: ReaderOptions -> Markdown -> Either PandocError Pandoc Source #
writePandoc :: WriterOptions -> Pandoc -> Html Source #
writePandocTrusted :: WriterOptions -> Pandoc -> Html Source #
Option sets
yesodDefaultWriterOptions :: WriterOptions Source #
Defaults plus Html5, minus WrapText
yesodDefaultReaderOptions :: ReaderOptions Source #
Defaults plus Smart and ParseRaw
Form helper
markdownField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Markdown Source #