From a6cbaff357e2c8f832be8ef76d21ef526430be39 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 29 Dec 2012 16:24:27 +0100 Subject: Link to proper haddock docs on hackage --- src/Hakyll/Core/Compiler.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs index 9a8f923..9fec69b 100644 --- a/src/Hakyll/Core/Compiler.hs +++ b/src/Hakyll/Core/Compiler.hs @@ -4,6 +4,7 @@ module Hakyll.Core.Compiler ( Compiler , getUnderlying + , getUnderlyingExtension , makeItem , getRoute , getResourceBody @@ -31,8 +32,8 @@ import Control.Applicative ((<$>)) import Data.Binary (Binary) import Data.ByteString.Lazy (ByteString) import Data.Typeable (Typeable) -import Prelude hiding (id, (.)) import System.Environment (getProgName) +import System.FilePath (takeExtension) -------------------------------------------------------------------------------- @@ -52,6 +53,13 @@ getUnderlying :: Compiler Identifier getUnderlying = compilerUnderlying <$> compilerAsk +-------------------------------------------------------------------------------- +-- | Get the extension of the underlying identifier. Returns something like +-- @".html"@ +getUnderlyingExtension :: Compiler String +getUnderlyingExtension = takeExtension . toFilePath <$> getUnderlying + + -------------------------------------------------------------------------------- makeItem :: a -> Compiler (Item a) makeItem x = do -- cgit v1.2.3