on master help sign in
Add withTagList
5dc0b60Oleg Grenrus
lib/Hakyll/Web/Html.hs+5−1
@@ -3,6 +3,7 @@
3module Hakyll.Web.Html
3module Hakyll.Web.Html
4 ( -- * Generic
4 ( -- * Generic
5 withTags
5 withTags
6+ , withTagList
6
7
7 -- * Headers
8 -- * Headers
8 , demoteHeaders
9 , demoteHeaders
@@ -36,8 +37,11 @@ import Network.URI (isUnreserved, escapeURIString)
36--------------------------------------------------------------------------------
37--------------------------------------------------------------------------------
37-- | Map over all tags in the document
38-- | Map over all tags in the document
38withTags :: (TS.Tag String -> TS.Tag String) -> String -> String
39withTags :: (TS.Tag String -> TS.Tag String) -> String -> String
39−withTags f = renderTags' . map f . parseTags'
40+withTags = withTagList . map
40
41
42+-- | Map over all tags (as list) in the document
43+withTagList :: ([TS.Tag String] -> [TS.Tag String]) -> String -> String
44+withTagList f = renderTags' . f . parseTags'
41
45
42--------------------------------------------------------------------------------
46--------------------------------------------------------------------------------
43-- | Map every @h1@ to an @h2@, @h2@ to @h3@, etc.
47-- | Map every @h1@ to an @h2@, @h2@ to @h3@, etc.