X-Git-Url: http://git.megacz.com/?p=wix.git;a=blobdiff_plain;f=src%2FHtml.lhs;h=a3ff54f19c3f0780bf5debf114110aa991bc5a5e;hp=632dcfea87ff06c97d9a1b7601ebc9b7975175aa;hb=78e11871be7fa7677a0e3822b6e08b3beca1c4b7;hpb=173630fcedd7f473b0b7d28592b53288c1eff418 diff --git a/src/Html.lhs b/src/Html.lhs index 632dcfe..a3ff54f 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"++ @@ -179,8 +183,9 @@ instance ToHtml Paragraph where toHtml (P t) = stag "p" $ toHtml t -link ref body = ""++icon++body++"" +link ref body = ""++icon++body++"" where + urlify = toHtml icon = if ".pdf" `isSuffixOf` ref then " " else if "mailto:" `isPrefixOf` ref then " " else "" @@ -232,6 +237,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" @@ -268,7 +275,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) = "‡" @@ -278,7 +285,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 @@ -306,7 +314,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)