@@ -1,32 +1,33 @@
1{-# LANGUAGE OverloadedStrings #-}
1{-# LANGUAGE OverloadedStrings #-}
2module GenerateHtml (generateHtml) where
2module GenerateHtml (generateHtml) where
4−import Text.Blaze.Html5 hiding (map)
4+import Text.Blaze (preEscapedToMarkup)
5import qualified Text.Blaze.Html5 as H
5import qualified Text.Blaze.Html5 as H
6−import Text.Blaze.Html5.Attributes
6+import Text.Blaze.Html5 ((!))
7import qualified Text.Blaze.Html5.Attributes as A
7import qualified Text.Blaze.Html5.Attributes as A
9+css = preEscapedToMarkup $
9−css = preEscapedString "* { padding:0; margin:0; \
10+ ("* { padding:0; margin:0; \
10− \hyphens: auto; -moz-hyphens: auto;\
11+ \hyphens: auto; -moz-hyphens: auto;\
11− \ -webkit-hyphens: auto; -ms-hyphens: auto; }\
12+ \ -webkit-hyphens: auto; -ms-hyphens: auto; }\
12− \body { font-family: Arial; }\
13+ \body { font-family: Arial; }\
13− \a:link {text-decoration: none}\
14+ \a:link {text-decoration: none}\
14− \a:visited {text-decoration: none}\
15+ \a:visited {text-decoration: none}\
15− \a:active {text-decoration: none}\
16+ \a:active {text-decoration: none}\
16− \a:hover {text-decoration: underline; color: #ff8f12;}"
17+ \a:hover {text-decoration: underline; color: #ff8f12;}" :: String)
18−makeScript :: String -> Html
19+makeScript :: String -> H.Html
19−makeScript s = script ! type_ "text/javascript" ! src (toValue s) $ ""
20+makeScript s = H.script ! A.type_ "text/javascript" ! A.src (H.toValue s) $ ""
21generateHtml libLoc title source =
22generateHtml libLoc title source =
22− docTypeHtml $ do
23+ H.docTypeHtml $ do
23 H.head $ do
24 H.head $ do
24− meta ! charset "UTF-8"
25+ H.meta ! A.charset "UTF-8"
25− H.title . toHtml $ title
26+ H.title . H.toHtml $ title
26 makeScript libLoc
27 makeScript libLoc
27− (script ! type_ "text/javascript") . preEscapedString $ source
28+ (H.script ! A.type_ "text/javascript") . preEscapedToMarkup $ source
28− H.style ! type_ "text/css" $ css
29+ H.style ! A.type_ "text/css" $ css
29− body $ do
30+ H.body $ do
30 H.div ! A.id "widthChecker" ! A.style "width:100%; height:1px; position:absolute; top:-1px;" $ ""
31 H.div ! A.id "widthChecker" ! A.style "width:100%; height:1px; position:absolute; top:-1px;" $ ""
31 H.span ! A.id "content" $ ""
32 H.span ! A.id "content" $ ""
32− script ! type_ "text/javascript" $ "Dispatcher.initialize()"
33+ H.script ! A.type_ "text/javascript" $ "Dispatcher.initialize()"