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

Octocat-spinner-32 Yesod explicit writerHighlight=True January 31, 2014
Octocat-spinner-32 LICENSE update license and cabal file February 06, 2012
Octocat-spinner-32 README.md add testing instructions August 19, 2012
Octocat-spinner-32 Setup.hs Scaffolding November 25, 2010
Octocat-spinner-32 Test.hs Update Test.hs for 1.2 May 29, 2013
Octocat-spinner-32 sample.md add file reading to Test.hs February 12, 2013
Octocat-spinner-32 yesod-markdown.cabal Bump dependency versions March 14, 2014
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.