@@ -1,37 +1,47 @@
1+--------------------------------------------------------------------------------
12-- | Module containing the template data structure
2−--
3−{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveDataTypeable #-}
4+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
45module Hakyll.Web.Template.Internal
56 ( Template (..)
67 , TemplateElement (..)
78 ) where
89
9−import Control.Applicative ((<$>))
1010
11−import Data.Binary (Binary, get, getWord8, put, putWord8)
12−import Data.Typeable (Typeable)
11+--------------------------------------------------------------------------------
12+import Control.Applicative ((<$>))
13+import Data.Binary (Binary, get, getWord8, put, putWord8)
14+import Data.Typeable (Typeable)
1315
14−import Hakyll.Core.Writable
1516
17+--------------------------------------------------------------------------------
18+import Hakyll.Core.Writable
19+
20+
21+--------------------------------------------------------------------------------
1622-- | Datatype used for template substitutions.
17−--
1823newtype Template = Template
1924 { unTemplate :: [TemplateElement]
2025 }
2126 deriving (Show, Eq, Binary, Typeable)
2227
28+
29+--------------------------------------------------------------------------------
2330instance Writable Template where
2431 -- Writing a template is impossible
2532 write _ _ = return ()
2633
34+
35+--------------------------------------------------------------------------------
2736-- | Elements of a template.
28−--
2937data TemplateElement
3038 = Chunk String
3139 | Key String
3240 | Escaped
3341 deriving (Show, Eq, Typeable)
3442
43+
44+--------------------------------------------------------------------------------
3545instance Binary TemplateElement where
3646 put (Chunk string) = putWord8 0 >> put string
3747 put (Key key) = putWord8 1 >> put key