Markdown processing for Yesod
Haskell Makefile
Clone or download
Pull request Compare This branch is 145 commits ahead of ajdunlap:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
src/Yesod
test
.codeclimate.yml
.gitignore
.hlint.yaml Configure linters Dec 22, 2017
.stylish-haskell.yaml Configure linters Dec 22, 2017
CHANGELOG.md
LICENSE
Makefile
README.md
Setup.hs
package.yaml
stack-lts-9.21.yaml Run multiple versions on CI Feb 28, 2018
stack.yaml

README.md

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 you're 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

CHANGELOG | LICENSE