diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-16 10:50:01 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-16 10:50:01 +0100 |
commit | 652ceb03f1185ad8d41e7a3b91f00e1064bdd4ba (patch) | |
tree | a269f96a06462531678263a0d678457f2b59af70 /src/Hakyll/Web/Template/Internal.hs | |
parent | e53ca6724c8f5715792ad6b269ede52f21eb606c (diff) | |
download | hakyll-652ceb03f1185ad8d41e7a3b91f00e1064bdd4ba.tar.gz |
Add applyJoinTemplateList, and a test for it
Diffstat (limited to 'src/Hakyll/Web/Template/Internal.hs')
-rw-r--r-- | src/Hakyll/Web/Template/Internal.hs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/Hakyll/Web/Template/Internal.hs b/src/Hakyll/Web/Template/Internal.hs index d0e0859..e264731 100644 --- a/src/Hakyll/Web/Template/Internal.hs +++ b/src/Hakyll/Web/Template/Internal.hs @@ -1,37 +1,47 @@ +-------------------------------------------------------------------------------- -- | Module containing the template data structure --- -{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Hakyll.Web.Template.Internal ( Template (..) , TemplateElement (..) ) where -import Control.Applicative ((<$>)) -import Data.Binary (Binary, get, getWord8, put, putWord8) -import Data.Typeable (Typeable) +-------------------------------------------------------------------------------- +import Control.Applicative ((<$>)) +import Data.Binary (Binary, get, getWord8, put, putWord8) +import Data.Typeable (Typeable) -import Hakyll.Core.Writable +-------------------------------------------------------------------------------- +import Hakyll.Core.Writable + + +-------------------------------------------------------------------------------- -- | Datatype used for template substitutions. --- newtype Template = Template { unTemplate :: [TemplateElement] } deriving (Show, Eq, Binary, Typeable) + +-------------------------------------------------------------------------------- instance Writable Template where -- Writing a template is impossible write _ _ = return () + +-------------------------------------------------------------------------------- -- | Elements of a template. --- data TemplateElement = Chunk String | Key String | Escaped deriving (Show, Eq, Typeable) + +-------------------------------------------------------------------------------- instance Binary TemplateElement where put (Chunk string) = putWord8 0 >> put string put (Key key) = putWord8 1 >> put key |