diff options
| author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-12-29 22:59:38 +0100 |
|---|---|---|
| committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-12-29 22:59:38 +0100 |
| commit | 6268e4a4fe961ca810da1ecb2275142a301f0813 (patch) | |
| tree | 00ac59620a114259d32f8bdd15874ebec15c6f9a /src/Hakyll/Web | |
| parent | bf31c55c99496fe20274df73a831fb1db86591e4 (diff) | |
| download | hakyll-6268e4a4fe961ca810da1ecb2275142a301f0813.tar.gz | |
Experimental arrow-based approach
Diffstat (limited to 'src/Hakyll/Web')
| -rw-r--r-- | src/Hakyll/Web/FileType.hs | 8 | ||||
| -rw-r--r-- | src/Hakyll/Web/Pandoc.hs | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/Hakyll/Web/FileType.hs b/src/Hakyll/Web/FileType.hs index a958fed..d5a9c56 100644 --- a/src/Hakyll/Web/FileType.hs +++ b/src/Hakyll/Web/FileType.hs @@ -7,10 +7,10 @@ module Hakyll.Web.FileType ) where import System.FilePath (takeExtension) -import Control.Applicative ((<$>)) +import Control.Arrow ((>>>), arr) import Hakyll.Core.Identifier -import Hakyll.Core.Target +import Hakyll.Core.Compiler -- | Datatype to represent the different file types Hakyll can deal with by -- default @@ -51,5 +51,5 @@ fileType = fileType' . takeExtension -- | Get the file type for the current file -- -getFileType :: TargetM FileType -getFileType = fileType . toFilePath <$> getIdentifier +getFileType :: Compiler () FileType +getFileType = getIdentifier >>> arr (fileType . toFilePath) diff --git a/src/Hakyll/Web/Pandoc.hs b/src/Hakyll/Web/Pandoc.hs index 17cac81..653c711 100644 --- a/src/Hakyll/Web/Pandoc.hs +++ b/src/Hakyll/Web/Pandoc.hs @@ -8,10 +8,12 @@ module Hakyll.Web.Pandoc , writePandocWith -- * Functions working on pages/targets + {- , pageReadPandoc , pageReadPandocWith , pageRenderPandoc , pageRenderPandocWith + -} -- * Default options , defaultParserState @@ -23,7 +25,7 @@ import Control.Applicative ((<$>)) import Text.Pandoc (Pandoc) import qualified Text.Pandoc as P -import Hakyll.Core.Target +import Hakyll.Core.Compiler import Hakyll.Web.FileType import Hakyll.Web.Page @@ -62,6 +64,7 @@ writePandocWith :: P.WriterOptions -- ^ Writer options for pandoc -> String -- ^ Resulting HTML writePandocWith = P.writeHtmlString +{- -- | Read the resource using pandoc -- pageReadPandoc :: Page String -> TargetM (Page Pandoc) @@ -88,6 +91,7 @@ pageRenderPandocWith :: P.ParserState pageRenderPandocWith state options page = do pandoc <- pageReadPandocWith state page return $ writePandocWith options <$> pandoc +-} -- | The default reader options for pandoc parsing in hakyll -- |
