X-Git-Url: http://git.megacz.com/?p=wix.git;a=blobdiff_plain;f=src%2FHtml.lhs;h=5784cb5a71b0d36f6561e005d91f3d431aa9c73f;hp=6fb939a3b5bdde4c7e1a5833f115c2b9f6111719;hb=5957ec155f716b36c7f3cd776bc74318ff3cb523;hpb=ee0d619aef56ddd0a03a430a809aa76a1d4fce59 diff --git a/src/Html.lhs b/src/Html.lhs index 6fb939a..5784cb5 100644 --- a/src/Html.lhs +++ b/src/Html.lhs @@ -1,4 +1,8 @@ \begin{code} +-- Copyright 2008 the Contributors, as shown in the revision logs. +-- Licensed under the Apache Public Source License 2.0 ("the License"). +-- You may not use this file except in compliance with the License. + module Html where import Edu_Berkeley_Sbp_Haskell_SBP @@ -27,7 +31,7 @@ style = " LI { margin-top: 5px; }\n"++ " body { color: #333333; }\n"++ " blockquote { font-style: italic; width: 100% }\n"++ - " div.warn { border: 1px solid red; background-color: #fbb; color: white; }\n"++ + " div.warn { border: 1px solid #f44; border-top: 5px solid #f44; background-color: #fbb; color: white; }\n"++ " td.warn { color: black; }\n"++ " div.announce { border: 1px solid green; background-color: #bfb; color: white; }\n"++ " td.announce { color: black; }\n"++ @@ -43,18 +47,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"++ @@ -195,6 +199,7 @@ instance ToHtml Text where toHtml (Quotes x) = "“"++(toHtml x)++"”" toHtml (Verbatim x) = pre x toHtml (Link t ref) = link (show ref) (toHtml t) + toHtml (Command "comment" y) = "" toHtml (Command "url" y) = ""++(link (toHtml y) (toHtml y))++"" toHtml (Command "WiX" y) = "WIX" toHtml (Command "TeX" y) = "TEX" @@ -231,6 +236,8 @@ instance ToHtml Text where toHtml (Command "green" y) = ""++(toHtml y)++"" toHtml (Command "sc" y) = ""++(toHtml y)++"" toHtml (Command "image" y) = "" + toHtml (Command "imagec" y) = "
" + toHtml (Command "image2" y) = "" toHtml (Command "image3" y) = "" toHtml (Command "image4" y) = "
" toHtml (Command "warn" y) = "\n
\n\n" @@ -246,7 +253,13 @@ instance ToHtml Text where toHtml (Command "br" _) = "\n
\n" toHtml (Command "cent" _) = "½" toHtml (Command "euro" _) = "€" - toHtml (Command "ordinal" x) = (toHtml x)++""++"th"++"" + + -- gross hack + toHtml (Command "ordinal" x) | (last (toHtml x) == '1') = (toHtml x)++""++"st"++"" + | (last (toHtml x) == '2') = (toHtml x)++""++"nd"++"" + | (last (toHtml x) == '3') = (toHtml x)++""++"rd"++"" + | otherwise = (toHtml x)++""++"th"++"" + -- FIXME: use "unicode vulgar fractions" here toHtml (Command "fraction" [n,d]) = ""++(toHtml n)++""++"/"++""++(toHtml d)++"" toHtml (Command "rfc" x) = "RFC"++(toHtml x)++"" @@ -261,7 +274,7 @@ instance ToHtml Text where toHtml (GlyphText TradeMark) = "™" toHtml (GlyphText ServiceMark) = "™" toHtml (GlyphText Emdash) = "—" - toHtml (GlyphText Ellipsis) = "…" + toHtml (GlyphText Ellipsis) = "…" -- &cdots;? toHtml (GlyphText Cent) = "½" toHtml (GlyphText Daggar) = "†" toHtml (GlyphText DoubleDaggar) = "‡" @@ -271,7 +284,8 @@ instance ToHtml Text where toHtml (GlyphText Sharp) = "⋘" toHtml (GlyphText CheckMark) = "✓" toHtml (GlyphText XMark) = "✗" - toHtml (GlyphText LeftArrow) = "&#;" -- FIXME + toHtml (GlyphText LeftArrow) = "←" + toHtml (GlyphText RightArrow) = "→" toHtml (GlyphText DoubleLeftArrow) = "&#;" -- FIXME toHtml (GlyphText DoubleRightArrow) = "&#;" -- FIXME toHtml (GlyphText DoubleLeftRightArrow) = "&#;" -- FIXME @@ -299,7 +313,7 @@ htmlEscapeChar '\'' = "'" htmlEscapeChar '\"' = """ htmlEscapeChar c = [c] -pre x = "\n
"++ (pre' x) ++ "\n
\n" +pre x = "\n
"++ (pre' x) ++ "\n
\n" where pre' (' ':b) = " "++(pre' b) pre' ('\n':b) = "
\n"++(pre' b)