yesod-markdown

Tools for using markdown in a yesod application

http://github.com/pbrisbin/yesod-markdown

Version on this page:0.12.6.1
LTS Haskell 22.36:0.12.6.14
Stackage Nightly 2024-10-03:0.12.6.14
Latest on Hackage:0.12.6.14

See all snapshots yesod-markdown appears in

GPL-2.0-only licensed by Alexander Dunlap, Patrick Brisbin
Maintained by Patrick Brisbin
This version can be pinned in stack with:yesod-markdown-0.12.6.1@sha256:c16a4c4d5126f7719b524edd040f08ca43bf6f6bcbc170ebf8c2ac4152c1d148,1737

Module documentation for 0.12.6.1

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

Changes

Unreleased

None

v0.12.6.1

  • Allow pandoc-2.6

v0.12.6.0

  • Allow pandoc-2.5

v0.12.5

  • Allow pandoc-2.4

v0.12.4

v0.12.3

  • Added markdownToHtmlWith & markdownToHtmlWithExtensions
  • Deprecate internal conversion functions

v0.12.2

v0.12.1

  • Allow pandoc-2.1

v0.12.0

  • Require pandoc-2.0, support GHC 8.2 (@cdepillabout)
  • Drop GHC 7.10 support

v0.11.4

v0.11.3

v0.11.2

No changes

v0.11.1

v0.11.0

  • Allow pandoc-1.16

v0.10.0

  • Require pandoc-1.14, support pandoc 1.15 (@robgssp)

v0.9.4

v0.9.3.1

v0.9.3

  • Allow yesod-1.4 (@nek0)

v0.9.2

v0.9.1

  • Remove temporary < 1.2.0.2 workaround
  • Add dependency bounds to avoid broken texmath-0.6.5.1

v0.9.0

  • Support shakespeare (renamed from hamlet package)

v0.8.5

  • Add upper bound on temporary-1.2.0.2
  • Write PersistFieldSql instance by hand

v0.8.4

  • Allow text-1.*
  • Allow blaze-html-0.7 and blaze-markup-0.7

v0.8.3

v0.8.2

v0.8.1

  • Derive PersistFieldSql

v0.8.0

v0.7.2

v0.7.1

  • Trim \r from textarea content

v0.7

  • Fix reading content with UTF-8 characters

v0.6

  • Support pandoce-1.10

v0.5.1

v0.5.0

  • Require yesod-1.1 and yesod-form-1.2 (@dlthomas)

v0.4.1

v0.4.0

  • Support yesod-1.0 (@pSub)

v0.3.4

  • Drop GHC 6 support (@pSub)

v0.3.3

v0.3.2

  • Require pandoc-1.9

v0.3.1

This is the first version where we begin tracking changes.