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

[ gpl, library, web, yesod ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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, 0.12.5, 0.12.6.0, 0.12.6.1, 0.12.6.2, 0.12.6.3, 0.12.6.4, 0.12.6.5, 0.12.6.6, 0.12.6.7, 0.12.6.8, 0.12.6.9, 0.12.6.11, 0.12.6.12, 0.12.6.13, 0.12.6.14
Change log CHANGELOG.md
Dependencies base (>=4.8.0 && <5), blaze-html (>=0.5), blaze-markup (>=0.5), bytestring (>=0.9), directory (>=1.3.3.0 && <1.4), pandoc (>=2.0), persistent (>=0.9), shakespeare (>=2.0), text (>=0.11), xss-sanitize (>=0.3.1), yesod-core (>=1.2), yesod-form (>=1.3) [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 2024-05-08T15:15:31Z
Distributions LTSHaskell:0.12.6.14, NixOS:0.12.6.14, Stackage:0.12.6.14
Reverse Dependencies 5 direct, 0 indirect [details]
Downloads 33735 total (70 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-05-08 [all 1 reports]

Readme for yesod-markdown-0.12.6.14

[back to package description]

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 your 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