hakyll-4.16.2.2: A static website compiler library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hakyll.Web.Pandoc

Contents

- The basic building blocks
- Derived compilers
- Default options

Description

Module exporting convenient pandoc bindings

Synopsis

- readPandoc :: Item String -> Compiler (Item Pandoc)
- readPandocWith :: ReaderOptions -> Item String -> Compiler (Item Pandoc)
- writePandoc :: Item Pandoc -> Item String
- writePandocWith :: WriterOptions -> Item Pandoc -> Item String
- renderPandoc :: Item String -> Compiler (Item String)
- renderPandocWith :: ReaderOptions -> WriterOptions -> Item String -> Compiler (Item String)
- renderPandocWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Item String -> Compiler (Item String)
- renderPandocWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Item String -> Compiler (Item String)
- pandocCompiler :: Compiler (Item String)
- pandocCompilerWith :: ReaderOptions -> WriterOptions -> Compiler (Item String)
- pandocCompilerWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler (Item String)
- pandocCompilerWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Compiler (Item String)
- defaultHakyllReaderOptions :: ReaderOptions
- defaultHakyllWriterOptions :: WriterOptions

# The basic building blocks

readPandoc Source #

Arguments

:: Item String | String to read
-> Compiler (Item Pandoc) | Resulting document

Read a string using pandoc, with the default options

readPandocWith Source #

Arguments

:: ReaderOptions | Parser options
-> Item String | String to read
-> Compiler (Item Pandoc) | Resulting document

Read a string using pandoc, with the supplied options

writePandoc Source #

Arguments

:: Item Pandoc | Document to write
-> Item String | Resulting HTML

Write a document (as HTML) using pandoc, with the default options

writePandocWith Source #

Arguments

:: WriterOptions | Writer options for pandoc
-> Item Pandoc | Document to write
-> Item String | Resulting HTML

Write a document (as HTML) using pandoc, with the supplied options

renderPandoc :: Item String -> Compiler (Item String) Source #

Render the resource using pandoc

renderPandocWith :: ReaderOptions -> WriterOptions -> Item String -> Compiler (Item String) Source #

Render the resource using pandoc

renderPandocWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Item String -> Compiler (Item String) Source #

An extension of `renderPandocWith`, which allows you to specify a custom Pandoc transformation on the input `Item`. Useful if you want to do your own transformations before running custom Pandoc transformations, e.g. using a `funcField` to transform raw content.

renderPandocWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Item String -> Compiler (Item String) Source #

Similar to `renderPandocWithTransform`, but the Pandoc transformation is monadic. This is useful when you want the pandoc transformation to use the `Compiler` information such as routes, metadata, etc. along with your own transformations beforehand.

# Derived compilers

pandocCompiler :: Compiler (Item String) Source #

Read a page render using pandoc

pandocCompilerWith :: ReaderOptions -> WriterOptions -> Compiler (Item String) Source #

A version of `pandocCompiler` which allows you to specify your own pandoc options

pandocCompilerWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler (Item String) Source #

An extension of `pandocCompilerWith` which allows you to specify a custom pandoc transformation for the content

pandocCompilerWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Compiler (Item String) Source #

Similar to `pandocCompilerWithTransform`, but the transformation function is monadic. This is useful when you want the pandoc transformation to use the `Compiler` information such as routes, metadata, etc

# Default options

defaultHakyllReaderOptions :: ReaderOptions Source #

The default reader options for pandoc parsing in hakyll

defaultHakyllWriterOptions :: WriterOptions Source #

The default writer options for pandoc rendering in hakyll