Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Yesod
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Setup.hs
Octocat-spinner-32 Test.hs
Octocat-spinner-32 sample.md
Octocat-spinner-32 yesod-markdown.cabal
README.md

Yesod markdown

A small wrapper over pandoc's powerful Markdown -> Html support with usage tailored for Yesod.

import Yesod.Markdown

This is a fork and continuation of a package originally by Alexander Dunlap.

Differences include:

  1. Updated to compile with newer dependencies
  2. Removed Yesod.Markdown.Macros
  3. Fixed and exported form field settings for Markdown fields
  4. Uses xss-sanitize by default and provides *Trusted functions to skip it

Usage

getPageR :: FilePath -> Handler RepHtml
getPageR fp = do
    content <- liftIO $ fmap markdownToHtml (markdownFromFile fp)

    defaultLayout do
        [shamlet|
            <div class="content">
                #{content}
            |]

Testing

$ cabal install
$ cabal install yesod warp
$ runhaskell Test.hs
$ $BROWSER http://localhost:3000
Something went wrong with that request. Please try again.