summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Util.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-23 14:31:30 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-23 14:31:30 +0100
commit9b63052148a140b8ad5fc04b996023d8b8e3796d (patch)
tree54029e3611381813ae035c5b270bf8709e2537bc /src/Text/Hakyll/Util.hs
parentfef1172c77e510054fc9bf95d5d2b85b8a15478e (diff)
downloadhakyll-9b63052148a140b8ad5fc04b996023d8b8e3796d.tar.gz
Remove old code for now
Diffstat (limited to 'src/Text/Hakyll/Util.hs')
-rw-r--r--src/Text/Hakyll/Util.hs34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/Text/Hakyll/Util.hs b/src/Text/Hakyll/Util.hs
deleted file mode 100644
index e032c52..0000000
--- a/src/Text/Hakyll/Util.hs
+++ /dev/null
@@ -1,34 +0,0 @@
--- | Miscellaneous text manipulation functions.
-module Text.Hakyll.Util
- ( trim
- , stripHtml
- , link
- ) where
-
-import Data.Char (isSpace)
-
-import Text.Blaze.Html5 ((!), string, stringValue, a)
-import Text.Blaze.Html5.Attributes (href)
-import Text.Blaze.Renderer.String (renderHtml)
-
--- | Trim a string (drop spaces, tabs and newlines at both sides).
-trim :: String -> String
-trim = reverse . trim' . reverse . trim'
- where
- trim' = dropWhile isSpace
-
--- | Strip html tags from the given string.
-stripHtml :: String -> String
-stripHtml [] = []
-stripHtml str = let (beforeTag, rest) = break (== '<') str
- (_, afterTag) = break (== '>') rest
- in beforeTag ++ stripHtml (drop 1 afterTag)
-
--- | Make a HTML link.
---
--- > link "foo" "bar.html" == "<a href='bar.html'>foo</a>"
-link :: String -- ^ Link text.
- -> String -- ^ Link destination.
- -> String
-link text destination = renderHtml $ a ! href (stringValue destination)
- $ string text