Safe Haskell | None |
---|
This module provides the functionallity to use pandocs reader for reStructuredText (RST) in Yesod. The code bases heavily on yesod-markdown from Patrick Brisbin, which does the same thing for Markdown.
- newtype RST = RST String
- rstToHtml :: RST -> Html
- rstToHtmlTrusted :: RST -> Html
- rstFromFile :: FilePath -> IO RST
- parseRST :: ParserState -> RST -> Pandoc
- writePandoc :: WriterOptions -> Pandoc -> Html
- writePandocTrusted :: WriterOptions -> Pandoc -> Html
- yesodDefaultWriterOptions :: WriterOptions
- yesodDefaultParserState :: ParserState
- rstField :: RenderMessage master FormMessage => Field sub master RST
Documentation
Wrappers
rstToHtmlTrusted :: RST -> HtmlSource
Converts RST to unsanitizied Html
rstFromFile :: FilePath -> IO RSTSource
Reads RST in from the specified file; returns the empty string if the file does not exist
Conversions
parseRST :: ParserState -> RST -> 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
rstField :: RenderMessage master FormMessage => Field sub master RSTSource