yesod-markdown-0.1: 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.

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, raw HTML parsing, and HTML sanitization.

yesodDefaultParserStateTrusted :: ParserStateSource

A set of default Pandoc reader options good for Yesod websites where the data input is trusted. Disables HTML sanitization and enables smart parsing and raw HTML parsing.