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