yesod-markdown-0.0: Markdown processing for Yesod sites using Pandoc

Yesod.Markdown

Contents

Description

This module provides functions for using Markdown with Yesod. An example pipeline could be

 (writePandoc defaultWriterOptions <$>) . localLinks . parseMarkdown defaultParserState

Synopsis

Documentation

parseMarkdown :: ParserState -> Markdown -> PandocSource

Read in Markdown to an intermediate Pandoc type.

localLinks :: Yesod master => Pandoc -> GHandler sub master PandocSource

Convert local (in-site) links. This function works on all link URLs that start with the two-character prefix ~:. It normalizes the links and replaces the ~: with the approot value for the site.

writePandoc :: WriterOptions -> Pandoc -> HtmlSource

Write untrusted Pandoc to Html. Calls sanitizeBalance from xss-sanitize.

writePandocTrusted :: WriterOptions -> Pandoc -> HtmlSource

Write trusted Pandoc to Html. Does not sanitize or balance tags.

Option sets

yesodDefaultWriterOptions :: WriterOptionsSource

A set of default Pandoc writer options good for Yesod websites. Enables Javascript-based email obfuscation, eliminates div tags around sections, and disables text wrapping.

yesodDefaultParserState :: ParserStateSource

A set of default Pandoc reader options good for Yesod websites. Enables smart parsing.

yesodDefaultParserStateTrusted :: ParserStateSource

A set of default Pandoc reader options good for Yesod websites where the data input is trusted. Enables raw HTML.