change visual appearance of links in html
[wix.git] / src / Html.lhs
index 295f131..a6cfeea 100644 (file)
@@ -43,18 +43,18 @@ style =
   " a:hover { text-decoration: none; border-bottom:1px solid; }\n"++
   " table.footer { border-top: silver solid 1px; }\n"++
   " span.signature { color: #bbb;  }\n"++
-  " .signature a:link { color: #bbb;  }\n"++
-  " .signature a:visited { color: #bbb;  }\n"++
+  " .signature a:link { color: #aaf;  }\n"++
+  " .signature a:visited { color: #faa;  }\n"++
   " .signature a:hover { color: blue; border-bottom: 1px solid blue;  }\n"++
   " span.highlight { background: yellow; color: black; padding: 3px }\n"++
   " div.pre {\n"++
   "     text-align: left;\n"++
   "     font-family: monospace;\n"++
-  "     border-style: solid;\n"++
+  "     border-style: none;\n"++
   "     border-width: 2px 2px 2px 2px;\n"++
   "     border-color: #6666aa;\n"++
   "     color: #FFFFFF;\n"++
-  "     background-color: #000000;\n"++
+  "     background-color: #333333;\n"++
   "     margin-right: 25px;\n"++
   "     margin-left: 25px;\n"++
   "     padding: 10px;\n"++
@@ -246,7 +246,13 @@ instance ToHtml Text where
  toHtml (Command "br" _)          = "\n<br/>\n"
  toHtml (Command "cent" _)        = "&#189;"
  toHtml (Command "euro" _)        = "&#8364;"
- toHtml (Command "ordinal" x)      = (toHtml x)++"<sup>"++"th"++"</sup>"
+
+ -- gross hack
+ toHtml (Command "ordinal" x) | (last (toHtml x) == '1') = (toHtml x)++"<sup>"++"st"++"</sup>"
+                              | (last (toHtml x) == '2') = (toHtml x)++"<sup>"++"nd"++"</sup>"
+                              | (last (toHtml x) == '3') = (toHtml x)++"<sup>"++"rd"++"</sup>"
+                              | otherwise                = (toHtml x)++"<sup>"++"th"++"</sup>"
+       
  -- FIXME: use "unicode vulgar fractions" here
  toHtml (Command "fraction" [n,d]) = "<sup>"++(toHtml n)++"</sup>"++"/"++"<sub>"++(toHtml d)++"</sub>"
  toHtml (Command "rfc" x)         = "<tt><a href=http://tools.ietf.org/html/rfc"++(toHtml x)++">RFC"++(toHtml x)++"</a></tt>"
@@ -291,18 +297,18 @@ instance ToHtml Text where
 
 instance ToHtml String where
   toHtml s = concatMap htmlEscapeChar s
-   where
-     htmlEscapeChar '<'  = "&lt;"
-     htmlEscapeChar '>'  = "&gt;"
-     htmlEscapeChar '&'  = "&amp;"
-     htmlEscapeChar '\'' = "&apos;"
-     htmlEscapeChar '\"' = "&quot;"
-     htmlEscapeChar c    = [c]
+
+htmlEscapeChar '<'  = "&lt;"
+htmlEscapeChar '>'  = "&gt;"
+htmlEscapeChar '&'  = "&amp;"
+htmlEscapeChar '\'' = "&apos;"
+htmlEscapeChar '\"' = "&quot;"
+htmlEscapeChar c    = [c]
 
 pre x = "\n<div class=pre>"++ (pre' x) ++ "\n</div>\n"
  where
   pre' (' ':b)         = "&nbsp;"++(pre' b)
   pre' ('\n':b)        = "<br/>\n"++(pre' b)
-  pre' (a:b)           = a:(pre' b)
+  pre' (a:b)           = (htmlEscapeChar a)++(pre' b)
   pre' []              = []
 \end{code}