summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-11 12:25:49 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-11 12:25:49 +0100
commit01d8c4b330ecbc8ca52bfbe659bdecad475bd1ab (patch)
tree480e1f7494c8c2c057dbbfe1d3c371d90e060c9f
parenta2c15932b713e81dcd1344f9227db2c3a65103bf (diff)
downloadhakyll-01d8c4b330ecbc8ca52bfbe659bdecad475bd1ab.tar.gz
Updated some comments.
-rw-r--r--src/Text/Hakyll/CreateContext.hs12
-rw-r--r--src/Text/Hakyll/Paginate.hs4
-rw-r--r--src/Text/Hakyll/Tags.hs8
3 files changed, 11 insertions, 13 deletions
diff --git a/src/Text/Hakyll/CreateContext.hs b/src/Text/Hakyll/CreateContext.hs
index 2e08850..24a97dd 100644
--- a/src/Text/Hakyll/CreateContext.hs
+++ b/src/Text/Hakyll/CreateContext.hs
@@ -69,12 +69,11 @@ createListing url templates renderables additional =
context = ("body", Right concatenation) : additional
concatenation = renderAndConcat templates renderables
--- | Combine two renderables. The url will always be taken from the first
+-- | Combine two @Context@s. The url will always be taken from the first
-- @Renderable@. Also, if a `$key` is present in both renderables, the
--- value from the first @Renderable@ will be taken as well.
+-- value from the first @Context@ will be taken as well.
--
--- Since renderables are always more or less key-value maps, you can see
--- this as a @union@ between two maps.
+-- You can see this as a this as a @union@ between two mappings.
combine :: HakyllAction () Context -> HakyllAction () Context
-> HakyllAction () Context
combine x y = HakyllAction
@@ -84,7 +83,7 @@ combine x y = HakyllAction
liftM2 M.union (runHakyllAction x) (runHakyllAction y)
}
--- | Combine two renderables and set a custom URL. This behaves like @combine@,
+-- | Combine two @Context@s and set a custom URL. This behaves like @combine@,
-- except that for the @url@ field, the given URL is always chosen.
combineWithUrl :: FilePath
-> HakyllAction () Context
@@ -92,8 +91,7 @@ combineWithUrl :: FilePath
-> HakyllAction () Context
combineWithUrl url x y = combine'
{ actionUrl = Just $ return url
- , actionFunction = \_ ->
- M.insert "url" url <$> runHakyllAction combine'
+ , actionFunction = \_ -> M.insert "url" url <$> runHakyllAction combine'
}
where
combine' = combine x y
diff --git a/src/Text/Hakyll/Paginate.hs b/src/Text/Hakyll/Paginate.hs
index b895cbb..a1a64e4 100644
--- a/src/Text/Hakyll/Paginate.hs
+++ b/src/Text/Hakyll/Paginate.hs
@@ -34,7 +34,7 @@ defaultPaginateConfiguration = PaginateConfiguration
}
-- | The most important function for pagination. This function operates on a
--- list of renderables (the pages), and basically just adds fields to them
+-- list of @Context@s (the pages), and basically just adds fields to them
-- by combining them with a custom page.
--
-- The following metadata fields will be added:
@@ -65,7 +65,7 @@ paginate configuration renderables = paginate' Nothing renderables (1 :: Int)
Nothing -> error "No link found for pagination."
-- The main function that creates combined renderables by recursing over
- -- the list of renderables.
+ -- the list of items.
paginate' _ [] _ = []
paginate' maybePrev (x:xs) index =
let (previous, first) = case maybePrev of
diff --git a/src/Text/Hakyll/Tags.hs b/src/Text/Hakyll/Tags.hs
index 5e9f76f..4efc02c 100644
--- a/src/Text/Hakyll/Tags.hs
+++ b/src/Text/Hakyll/Tags.hs
@@ -92,7 +92,7 @@ readMap getTagsFunction identifier paths = HakyllAction
return $ foldr addPaths' current tags
-- | Read a @TagMap@, using the @tags@ metadata field.
-readTagMap :: String -- ^ Unique identifier for the map.
+readTagMap :: String -- ^ Unique identifier for the map.
-> [FilePath] -- ^ Paths to get tags from.
-> HakyllAction () TagMap
readTagMap = readMap getTagsFunction
@@ -101,7 +101,7 @@ readTagMap = readMap getTagsFunction
. fromMaybe [] . M.lookup "tags"
-- | Read a @TagMap@, using the subdirectories the pages are placed in.
-readCategoryMap :: String -- ^ Unique identifier for the map.
+readCategoryMap :: String -- ^ Unique identifier for the map.
-> [FilePath] -- ^ Paths to get tags from.
-> HakyllAction () TagMap
readCategoryMap = readMap $ maybeToList . M.lookup "category"
@@ -115,8 +115,8 @@ withTagMap tagMap function = runHakyllAction (tagMap >>> action)
-- | Render a tag cloud.
renderTagCloud :: (String -> String) -- ^ Function to produce an url for a tag.
- -> Float -- ^ Smallest font size, in percent.
- -> Float -- ^ Biggest font size, in percent.
+ -> Float -- ^ Smallest font size, in percent.
+ -> Float -- ^ Biggest font size, in percent.
-> HakyllAction TagMap String
renderTagCloud urlFunction minSize maxSize = createHakyllAction renderTagCloud'
where