on master help sign in
Documented Text.Hakyll.Renderables.
commit0bbb99ed2fd592d60496e2af5d2ed401ab06697c authorJasper Van der Jeugt <jaspervdj@gmail.com> dateSat 12 Dec 2009, 15:54 (17 years ago) parent30deeb3
1 file changed+13−7
src/Text/Hakyll/Renderables.hs+13−7
src/Text/Hakyll/Renderables.hs+13−7
@@ -13,14 +13,17 @@ import Text.Hakyll.Util
1313import Text.Hakyll.Page
1414import Text.Hakyll.Renderable
1515
16−data CustomPage = CustomPage { url :: String,
17− dependencies :: [FilePath],
18− mapping :: [(String, Either String (IO B.ByteString))]
19− }
16+-- | A custom page.
17+data CustomPage = CustomPage
18+ { url :: String,
19+ dependencies :: [FilePath],
20+ mapping :: [(String, Either String (IO B.ByteString))]
21+ }
2022
21−createCustomPage :: String
22− -> [FilePath]
23− -> [(String, Either String (IO B.ByteString))]
23+-- | Create a custom page.
24+createCustomPage :: String -- ^ Destination of the page, relative to _site.
25+ -> [FilePath] -- ^ Dependencies of the page.
26+ -> [(String, Either String (IO B.ByteString))] -- ^ Key - value mapping for rendering.
2427 -> CustomPage
2528createCustomPage = CustomPage
2629
@@ -32,8 +35,11 @@ instance Renderable CustomPage where
3235 let keys = map (B.pack . fst) (mapping page)
3336 return $ M.fromList $ (B.pack "url", B.pack $ url page) : zip keys values
3437
38+-- | PagePath is a class that wraps a FilePath. This is used to render Pages
39+-- without reading them first through use of caching.
3540data PagePath = PagePath FilePath
3641
42+-- | Create a PagePath from a FilePath.
3743createPagePath :: FilePath -> PagePath
3844createPagePath = PagePath
3945