heist-0.14.1.1: An Haskell template system supporting both HTML5 and XML.

Safe Haskell | None
Language | Haskell98

Heist.Splices.Markdown

Description

The "markdown" splice formats markdown content as HTML and inserts it into the document.

If the file attribute is present the contents of the tag is ignored and the file specified is converted to HTML.

Otherwise the non-markup children of the tag are processed as markdown and converted to HTML.

This splice requires that the "pandoc" executable is in your path.

Synopsis

- data PandocMissingException = PandocMissingException
- data MarkdownException = MarkdownException ByteString
- data NoMarkdownFileException = NoMarkdownFileException
- markdownTag :: Text
- markdownSplice :: MonadIO m => Splice m
- pandoc :: FilePath -> FilePath -> FilePath -> IO ByteString
- pandocBS :: FilePath -> ByteString -> IO ByteString
- readProcessWithExitCode' :: FilePath -> [String] -> ByteString -> IO (ExitCode, ByteString, ByteString)

# Documentation

data PandocMissingException Source

Constructors

PandocMissingException |

Instances

Show PandocMissingException Source |
Exception PandocMissingException Source |

data MarkdownException Source

Constructors

MarkdownException ByteString |

Instances

Show MarkdownException Source |
Exception MarkdownException Source |

data NoMarkdownFileException Source

Constructors

NoMarkdownFileException |

Instances

Show NoMarkdownFileException Source |
Exception NoMarkdownFileException Source |

markdownTag :: Text Source

Default name for the markdown splice.

markdownSplice :: MonadIO m => Splice m Source

Implementation of the markdown splice.

pandoc :: FilePath -> FilePath -> FilePath -> IO ByteString Source

pandocBS :: FilePath -> ByteString -> IO ByteString Source

readProcessWithExitCode' Source

Arguments

:: FilePath | command to run
-> [String] | any arguments
-> ByteString | standard input
-> IO (ExitCode, ByteString, ByteString) | exitcode, stdout, stderr