diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2014-01-28 11:04:28 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2014-01-28 11:04:28 +0100 |
commit | 251c019e9e11e99142109a3235d71cc605a14232 (patch) | |
tree | abdc242dc32ce4b1ea58dbbca02482c4f8728468 /src/Hakyll | |
parent | ca20400712d2b740672d70fbd64b7cec788393ce (diff) | |
download | hakyll-251c019e9e11e99142109a3235d71cc605a14232.tar.gz |
Don't cache pandocCompilerWithTransform, refactor
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Web/Pandoc.hs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Hakyll/Web/Pandoc.hs b/src/Hakyll/Web/Pandoc.hs index 77f06c9..1615167 100644 --- a/src/Hakyll/Web/Pandoc.hs +++ b/src/Hakyll/Web/Pandoc.hs @@ -101,7 +101,9 @@ pandocCompiler = -- | A version of 'pandocCompiler' which allows you to specify your own pandoc -- options pandocCompilerWith :: ReaderOptions -> WriterOptions -> Compiler (Item String) -pandocCompilerWith ropt wopt = pandocCompilerWithTransform ropt wopt id +pandocCompilerWith ropt wopt = + cached "Hakyll.Web.Pandoc.pandocCompilerWith" $ + pandocCompilerWithTransform ropt wopt id -------------------------------------------------------------------------------- @@ -110,10 +112,9 @@ pandocCompilerWith ropt wopt = pandocCompilerWithTransform ropt wopt id pandocCompilerWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler (Item String) -pandocCompilerWithTransform ropt wopt f = cached cacheName $ - writePandocWith wopt . fmap f . readPandocWith ropt <$> getResourceBody - where - cacheName = "Hakyll.Web.Page.pageCompilerWithPandoc" +pandocCompilerWithTransform ropt wopt f = + pandocCompilerWithTransformM ropt wopt (return . f) + -------------------------------------------------------------------------------- -- | Similar to 'pandocCompilerWithTransform', but the transformation @@ -123,12 +124,10 @@ pandocCompilerWithTransform ropt wopt f = cached cacheName $ pandocCompilerWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Compiler (Item String) -pandocCompilerWithTransformM ropt wopt f = cached cacheName $ +pandocCompilerWithTransformM ropt wopt f = writePandocWith wopt <$> - (traverse f - =<< readPandocWith ropt <$> getResourceBody) - where - cacheName = "Hakyll.Web.Page.pageCompilerWithPandoc" + (traverse f =<< readPandocWith ropt <$> getResourceBody) + -------------------------------------------------------------------------------- -- | The default reader options for pandoc parsing in hakyll |