Markdown processing for Yesod
Clone or download
Pull request Compare This branch is 175 commits ahead of ajdunlap:master.
Latest commit ebf0324 Nov 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Re-enable nightly Nov 23, 2018
src/Yesod Update to LTS-12 Aug 1, 2018
test Support pandoc-2.2.3 Sep 23, 2018
.codeclimate.yml Add .codeclimate.yml Feb 14, 2017
.gitignore Move to hpack Dec 22, 2017
.stylish-haskell.yaml Configure linters Dec 22, 2017
CHANGELOG.md Version bump Nov 29, 2018
LICENSE update license and cabal file Feb 6, 2012
Makefile Re-enable nightly Nov 23, 2018
README.md Update README Mar 20, 2018
Setup.hs Scaffolding Nov 25, 2010
package.yaml Version bump Nov 29, 2018
stack-lts-11.19.yaml Update to LTS-12 Aug 1, 2018
stack-lts-12.10.yaml Restyled Sep 23, 2018
stack-lts-9.21.yaml Run multiple versions on CI Feb 28, 2018
stack-nightly.yaml Allow and test with pandoc-2.5 Nov 29, 2018
stack.yaml Restyled Sep 23, 2018

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