yesod-markdown

A subset of Pandoc functionality useful for markdown processing in yesod applications


Keywords
library, web, yesod, Propose Tags, Skip to Readme, , Index, Quick Jump, Yesod.Markdown, yesod-markdown-0.12.6.13.tar.gz, browse, Package description, Package maintainers, AlexanderDunlap, PatrickBrisbin, edit package information , Pandoc, extensions, haddocks, CHANGELOG, LICENSE
License
GPL-2.0-only
Install
cabal install yesod-markdown-0.12.6.13

Documentation

Yesod Markdown

Hackage Stackage Nightly Stackage LTS CI

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