yesod-markdown: Tools for using markdown in a yesod application

[ gpl, library, web, yesod ] [ Propose Tags ]

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


[Skip to Readme]
Versions 0.0, 0.1, 0.2.1, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6, 0.7, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.3.1, 0.9.4, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.12.0, 0.12.1, 0.12.2, 0.12.3
Dependencies base (>=4.8.0 && <5), blaze-html (>=0.5 && <0.10), blaze-markup (>=0.5 && <0.9), bytestring (>=0.9 && <0.11), directory, pandoc (>=2.0 && <2.2), persistent (>=0.9), shakespeare (==2.0.*), text (>=0.11 && <2.0), xss-sanitize (>=0.3.1 && <0.4), yesod-core (>=1.2 && <1.7), yesod-form (>=1.3 && <1.7) [details]
License GPL-2.0-only
Author Alexander Dunlap, Patrick Brisbin
Maintainer Patrick Brisbin <pbrisbin@gmail.com>
Category Web, Yesod
Home page http://github.com/pbrisbin/yesod-markdown
Bug tracker https://github.com/pbrisbin/yesod-markdown/issues
Source repo head: git clone https://github.com/pbrisbin/yesod-markdown
Uploaded by PatrickBrisbin at Wed Mar 7 13:35:12 UTC 2018
Distributions Debian:0.8.5, NixOS:0.12.3
Downloads 10256 total (34 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-07 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for yesod-markdown-0.12.3

[back to package description]

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:

extensions

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