diff options
author | panne <unknown> | 2004-08-03 21:07:59 +0000 |
---|---|---|
committer | panne <unknown> | 2004-08-03 21:07:59 +0000 |
commit | 14aaf2e56fc6e1c9aba393d7fe285118b97c044a (patch) | |
tree | 39ae107101942febf2f45f4f2263aad337d402eb /src/HaddockHtml.hs | |
parent | 4770643a17c988e364c06a88c05349a76360f8a9 (diff) |
[haddock @ 2004-08-03 21:07:58 by panne]
Improved spacing of dynamic module tree
Diffstat (limited to 'src/HaddockHtml.hs')
-rw-r--r-- | src/HaddockHtml.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index ffd9da47..96d8d816 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -252,7 +252,7 @@ ppPrologue title (Just doc) = ppModuleTree :: String -> [ModuleTree] -> HtmlTable ppModuleTree _ ts = tda [theclass "section1"] << toHtml "Modules" </> - pad_td 0 << vanillaTable << htmlTable + pad_td Nothing << vanillaTable << htmlTable where genTable htmlTable id [] = (htmlTable,id) genTable htmlTable id (x:xs) = genTable (htmlTable </> u) id' xs @@ -265,9 +265,9 @@ mkNode :: [String] -> ModuleTree -> Int -> (HtmlTable,Int) 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 +++ toHtml " " +++ htmlModule) <-> htmlPkg) </> - (pad_td 20 << sub_tree), id') + [] -> ( pad_td (Just 1.25) << htmlModule <-> htmlPkg,id) + _ -> ((pad_td Nothing<< (collapsebutton id_s +++ htmlModule) <-> htmlPkg) </> + (pad_td (Just 2) << sub_tree), id') htmlModule | leaf = ppHsModule mdl @@ -293,8 +293,9 @@ mkNode ss (Node s leaf pkg ts) id = htmlNode where (u,id') = mkNode (s:ss) x id -pad_td 0 = tda [width "100%"] -pad_td n = tda [thestyle ("padding-left:" ++ show n ++ "px"), width "100%"] +pad_td :: Maybe Float -> Html -> HtmlTable +pad_td Nothing = tda [width "100%"] +pad_td (Just n) = tda [thestyle ("padding-left:" ++ show n ++ "em"), width "100%"] -- --------------------------------------------------------------------------- -- Generate the index |