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, 0.12.4
Change log CHANGELOG.md
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.3), 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 Mon Nov 12 16:23:48 UTC 2018
Distributions Debian:0.8.5, NixOS:0.12.4
Downloads 10971 total (67 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2018-11-12 [all 3 reports]
Hackage Matrix CI

Modules

  • Yesod
    • Yesod.Markdown

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for yesod-markdown-0.12.4

[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:

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