A small wrapper over Pandoc's powerful Markdown -> Html
support, with
usage tailored for Yesod.
getPageR :: FilePath -> Handler RepHtml
getPageR fp = do
content <- liftIO
$ fmap markdownToHtml
$ markdownFromFile fp
defaultLayout $ do
[shamlet|
<div class="content">
#{content}
|]
The default extensions are minimal, you can specify your preferred
extensions with markdownToHtmlWithExtensions
:
import Text.Pandoc.Extensions (githubMarkdownExtensions)
getPageR :: FilePath -> Handler RepHtml
getPageR fp = do
content <- liftIO
$ fmap (markdownToHtmlWithExtensions githubMarkdownExtensions)
$ markdownFromFile fp
defaultLayout $ do
[shamlet|
<div class="content">
#{content}
|]
For more information, see the haddocks.
stack setup
stack build --pedantic --test