aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanne <unknown>2004-08-03 19:44:03 +0000
committerpanne <unknown>2004-08-03 19:44:03 +0000
commitdd5f394e3fe1e83321a7fc70387306a133ed1eb2 (patch)
treeb52546306fdfc4c7426d05a5a47f91ce88c5e22d
parentb1f7dc88372572b0eb4774ac121c49058b4cc659 (diff)
[haddock @ 2004-08-03 19:44:03 by panne]
Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before)
-rw-r--r--src/HaddockHtml.hs36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index bf4d46ee..3cb55ce9 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -219,8 +219,9 @@ ppHtmlContents odir doctitle maybe_package maybe_html_help_format maybe_index_ur
let tree = mkModuleTree [(mod,iface_package iface) | (mod,iface) <- mdls]
html =
header
- ((thetitle (toHtml doctitle)) +++
- (thelink ! [href cssFile, rel "stylesheet", thetype "text/css"]) +++
+ (documentCharacterEncoding +++
+ thetitle (toHtml doctitle) +++
+ styleSheet +++
(script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++
body << vanillaTable << (
simpleHeader doctitle Nothing maybe_index_url </>
@@ -262,7 +263,7 @@ mkNode ss (Node s leaf pkg ts) id = htmlNode
where
htmlNode = case ts of
[] -> ( pad_td 15 << htmlModule <-> htmlPkg,id)
- _ -> ((pad_td 0 << (collapsebutton id_s +++ htmlModule) <-> htmlPkg) </>
+ _ -> ((pad_td 0 << (collapsebutton id_s +++ toHtml " " +++ htmlModule) <-> htmlPkg) </>
(pad_td 20 << sub_tree), id')
htmlModule
@@ -277,7 +278,7 @@ mkNode ss (Node s leaf pkg ts) id = htmlNode
(s':ss') = reverse (s:ss)
-- reconstruct the module name
- id_s = show id
+ id_s = "n:" ++ show id
(sub_tree,id') = genSubTree emptyTable (id+1) ts
@@ -304,9 +305,9 @@ ppHtmlIndex :: FilePath
-> IO ()
ppHtmlIndex odir doctitle maybe_package maybe_html_help_format maybe_contents_url ifaces = do
let html =
- header (thetitle (toHtml (doctitle ++ " (Index)")) +++
- thelink ! [href cssFile,
- rel "stylesheet", thetype "text/css"]) +++
+ header (documentCharacterEncoding +++
+ thetitle (toHtml (doctitle ++ " (Index)")) +++
+ styleSheet) +++
body << vanillaTable << (
simpleHeader doctitle maybe_contents_url Nothing </>
index_html
@@ -347,9 +348,9 @@ ppHtmlIndex odir doctitle maybe_package maybe_html_help_format maybe_contents_ur
= unless (null index_part) $
writeFile (pathJoin [odir, subIndexHtmlFile c]) (renderHtml html)
where
- html = header (thetitle (toHtml (doctitle ++ " (Index)")) +++
- thelink ! [href cssFile,
- rel "stylesheet", thetype "text/css"]) +++
+ html = header (documentCharacterEncoding +++
+ thetitle (toHtml (doctitle ++ " (Index)")) +++
+ styleSheet) +++
body << vanillaTable << (
simpleHeader doctitle maybe_contents_url Nothing </>
indexInitialLetterLinks </>
@@ -424,9 +425,9 @@ ppHtmlModule
ppHtmlModule odir doctitle source_url
maybe_contents_url maybe_index_url (Module mdl,iface) = do
let html =
- header (thetitle (toHtml mdl) +++
- thelink ! [href cssFile,
- rel "stylesheet", thetype "text/css"] +++
+ header (documentCharacterEncoding +++
+ thetitle (toHtml mdl) +++
+ styleSheet +++
(script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++
body << vanillaTable << (
pageHeader mdl iface doctitle source_url
@@ -1150,7 +1151,7 @@ namedAnchor n = anchor ! [name (escapeStr n)]
--
collapsebutton :: String -> Html
collapsebutton id =
- image ! [ src plusFile, theclass "coll", onclick ("toggle(this,'" ++ id ++ "')") ]
+ image ! [ src plusFile, theclass "coll", onclick ("toggle(this,'" ++ id ++ "')"), alt "show/hide" ]
collapsed :: String -> Html -> Html
collapsed id html =
@@ -1166,3 +1167,10 @@ linkedAnchor frag = anchor ! [href hr]
where hr | null frag = ""
| otherwise = '#': escapeStr frag
+documentCharacterEncoding :: Html
+documentCharacterEncoding =
+ meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"]
+
+styleSheet :: Html
+styleSheet =
+ thelink ! [href cssFile, rel "stylesheet", thetype "text/css"]