summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Page/Read.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-27 10:12:19 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-27 10:12:19 +0100
commitd25dcb698e37765f35edf4c6e9b38e1d9dbb578e (patch)
tree2970fc00879b809b302bd98150920989e685c34b /src/Hakyll/Web/Page/Read.hs
parentc1d16cdab337274a9f5aca40b887371ca1a1f5a1 (diff)
downloadhakyll-d25dcb698e37765f35edf4c6e9b38e1d9dbb578e.tar.gz
Fix typo in comments
Diffstat (limited to 'src/Hakyll/Web/Page/Read.hs')
-rw-r--r--src/Hakyll/Web/Page/Read.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Hakyll/Web/Page/Read.hs b/src/Hakyll/Web/Page/Read.hs
index f840eba..c886fab 100644
--- a/src/Hakyll/Web/Page/Read.hs
+++ b/src/Hakyll/Web/Page/Read.hs
@@ -18,11 +18,6 @@ import Hakyll.Web.Util.String
--
type LineParser = State [String]
--- | Check if the given string is a metadata delimiter.
---
-isPossibleDelimiter :: String -> Bool
-isPossibleDelimiter = isPrefixOf "---"
-
-- | Read the metadata section from a page
--
parseMetadata :: LineParser (Map String String)
@@ -31,7 +26,7 @@ parseMetadata = get >>= \content -> case content of
[] -> return M.empty
-- Check if the file begins with a delimiter
(l : ls) -> if not (isPossibleDelimiter l)
- then -- No delimiter means no body
+ then -- No delimiter means no metadata
return M.empty
else do -- Break the metadata section
let (metadata, rest) = second (drop 1) $ break (== l) ls
@@ -40,7 +35,10 @@ parseMetadata = get >>= \content -> case content of
-- Parse the metadata
return $ M.fromList $ map parseMetadata' metadata
where
- parseMetadata' :: String -> (String, String)
+ -- Check if a line can be a delimiter
+ isPossibleDelimiter = isPrefixOf "---"
+
+ -- Parse a "key: value" string to a (key, value) tupple
parseMetadata' = (trim *** trim . drop 1) . break (== ':')
-- | Read the body section of a page