summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Web/Page.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs
index 5146bdc..a9c622c 100644
--- a/src/Hakyll/Web/Page.hs
+++ b/src/Hakyll/Web/Page.hs
@@ -53,6 +53,7 @@ module Hakyll.Web.Page
, toMap
, readPageCompiler
, pageCompiler
+ , pageCompilerWith
, addDefaultFields
, sortByBaseName
) where
@@ -65,6 +66,8 @@ import qualified Data.Map as M
import Data.List (sortBy)
import Data.Ord (comparing)
+import Text.Pandoc (ParserState, WriterOptions)
+
import Hakyll.Core.Identifier
import Hakyll.Core.Compiler
import Hakyll.Core.Resource
@@ -91,6 +94,14 @@ pageCompiler :: Compiler Resource (Page String)
pageCompiler = cached "Hakyll.Web.Page.pageCompiler" $
readPageCompiler >>> addDefaultFields >>> arr applySelf >>> pageRenderPandoc
+-- | A version of 'pageCompiler' which allows you to specify your own pandoc
+-- options
+--
+pageCompilerWith :: ParserState -> WriterOptions -> Compiler Resource (Page String)
+pageCompilerWith state options = cached "pageCompilerWith" $
+ readPageCompiler >>> addDefaultFields >>> arr applySelf
+ >>> pageRenderPandocWith state options
+
-- | Add a number of default metadata fields to a page. These fields include:
--
-- * @$url@