summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Provider
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-05-04 11:36:58 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2013-05-04 11:36:58 +0200
commit4100083709a894225717dbe3068f73057e908dd6 (patch)
treebd519b91f8e3dcbdab03a5807112997d56d55d75 /src/Hakyll/Core/Provider
parent28bc3f1f3b98f3bf4c8601af8eb8fa7a9c226ed2 (diff)
downloadhakyll-4100083709a894225717dbe3068f73057e908dd6.tar.gz
Style changes, move stuff to common parser module
Diffstat (limited to 'src/Hakyll/Core/Provider')
-rw-r--r--src/Hakyll/Core/Provider/Metadata.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Provider/Metadata.hs b/src/Hakyll/Core/Provider/Metadata.hs
index 0d94ad7..fe2857a 100644
--- a/src/Hakyll/Core/Provider/Metadata.hs
+++ b/src/Hakyll/Core/Provider/Metadata.hs
@@ -4,6 +4,9 @@ module Hakyll.Core.Provider.Metadata
( loadMetadata
, metadata
, page
+
+ -- This parser can be reused in some places
+ , metadataKey
) where
@@ -23,6 +26,7 @@ import Text.Parsec.String (Parser)
import Hakyll.Core.Identifier
import Hakyll.Core.Metadata
import Hakyll.Core.Provider.Internal
+import Hakyll.Core.Util.Parser
import Hakyll.Core.Util.String
@@ -93,7 +97,8 @@ newline = P.string "\n" <|> P.string "\r\n"
-- | Parse a single metadata field
metadataField :: Parser (String, String)
metadataField = do
- key <- P.manyTill P.alphaNum $ P.char ':'
+ key <- metadataKey
+ _ <- P.char ':'
P.skipMany1 inlineSpace <?> "space followed by metadata for: " ++ key
value <- P.manyTill P.anyChar newline
trailing' <- P.many trailing