summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-12 15:54:43 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-12 15:54:43 +0100
commit0bbb99ed2fd592d60496e2af5d2ed401ab06697c (patch)
tree1c88481ef486394b93f8c53ae2e0b2512f8641cd /src/Text
parent30deeb343509b91eaade13de90528bd5bcc40158 (diff)
downloadhakyll-0bbb99ed2fd592d60496e2af5d2ed401ab06697c.tar.gz
Documented Text.Hakyll.Renderables.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Hakyll/Renderables.hs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/Text/Hakyll/Renderables.hs b/src/Text/Hakyll/Renderables.hs
index 17b987d..47ef5db 100644
--- a/src/Text/Hakyll/Renderables.hs
+++ b/src/Text/Hakyll/Renderables.hs
@@ -13,14 +13,17 @@ import Text.Hakyll.Util
import Text.Hakyll.Page
import Text.Hakyll.Renderable
-data CustomPage = CustomPage { url :: String,
- dependencies :: [FilePath],
- mapping :: [(String, Either String (IO B.ByteString))]
- }
+-- | A custom page.
+data CustomPage = CustomPage
+ { url :: String,
+ dependencies :: [FilePath],
+ mapping :: [(String, Either String (IO B.ByteString))]
+ }
-createCustomPage :: String
- -> [FilePath]
- -> [(String, Either String (IO B.ByteString))]
+-- | Create a custom page.
+createCustomPage :: String -- ^ Destination of the page, relative to _site.
+ -> [FilePath] -- ^ Dependencies of the page.
+ -> [(String, Either String (IO B.ByteString))] -- ^ Key - value mapping for rendering.
-> CustomPage
createCustomPage = CustomPage
@@ -32,8 +35,11 @@ instance Renderable CustomPage where
let keys = map (B.pack . fst) (mapping page)
return $ M.fromList $ (B.pack "url", B.pack $ url page) : zip keys values
+-- | PagePath is a class that wraps a FilePath. This is used to render Pages
+-- without reading them first through use of caching.
data PagePath = PagePath FilePath
+-- | Create a PagePath from a FilePath.
createPagePath :: FilePath -> PagePath
createPagePath = PagePath