module Hakyllbars.Pandoc where
import Hakyll hiding (pandocCompilerWith)
import System.FilePath
import Text.Pandoc
pandocCompiler :: Item String -> Compiler (Item String)
pandocCompiler :: Item String -> Compiler (Item String)
pandocCompiler = ReaderOptions
-> WriterOptions -> Item String -> Compiler (Item String)
pandocCompilerWith ReaderOptions
defaultHakyllReaderOptions WriterOptions
defaultHakyllWriterOptions
pandocCompilerWith :: ReaderOptions -> WriterOptions -> Item String -> Compiler (Item String)
pandocCompilerWith :: ReaderOptions
-> WriterOptions -> Item String -> Compiler (Item String)
pandocCompilerWith ReaderOptions
readerOpts WriterOptions
writerOpts item :: Item String
item@(Item Identifier
id' String
_) = do
let ext :: String
ext = String -> String
takeExtension forall a b. (a -> b) -> a -> b
$ Identifier -> String
toFilePath Identifier
id'
String -> Compiler (Item String)
go String
ext
where
go :: String -> Compiler (Item String)
go String
".html" = forall (m :: * -> *) a. Monad m => a -> m a
return Item String
item
go String
_ = ReaderOptions
-> WriterOptions -> Item String -> Compiler (Item String)
renderPandocWith ReaderOptions
readerOpts WriterOptions
writerOpts Item String
item