@hackage yesod-markdown0.12.6.14
Tools for using markdown in a yesod application
Categories
License
GPL-2.0-only
Maintainer
Patrick Brisbin <pbrisbin@gmail.com>
Links
Versions
Installation
Dependencies (12)
- base >=4.8.0 && <5
- blaze-html >=0.5
- blaze-markup >=0.5
- bytestring >=0.9
- directory >=1.3.3.0 && <1.4
- pandoc >=2.0 Show all…
Dependents (6)
@hackage/yesod-raml-docs, @hackage/yesod-comments, @hackage/acme-everything, @hackage/yesod-bootstrap, @hackage/yesod-raml-bin, @hackage/yesod-crud-persist
Yesod Markdown
A small wrapper over Pandoc's powerful Markdown -> Html support, with
usage tailored for Yesod.
Usage
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.
Developing & Tests
stack setup
stack build --pedantic --test