diff options
author | simonmar <unknown> | 2002-06-20 12:39:02 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-06-20 12:39:02 +0000 |
commit | f467a9b6f442dd4ffe823ad36b8879d490f649f8 (patch) | |
tree | 2ab680bc0ec1fce8c3bdd270bb3824838ca9b99d /src/HaddockHtml.hs | |
parent | e13b5af42f8921146059a74ad4a8c4818d05db0a (diff) |
[haddock @ 2002-06-20 12:39:01 by simonmar]
Add support for a "prologue" - a description for the whole library,
placed on the contents page before the module list.
Diffstat (limited to 'src/HaddockHtml.hs')
-rw-r--r-- | src/HaddockHtml.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index cebb9690..4739c84b 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -46,8 +46,10 @@ ppHtml :: String -> Maybe String -- CSS file -> String -- $libdir -> InstMaps + -> Maybe Doc -- prologue text, maybe -> IO () -ppHtml title source_url ifaces odir maybe_css libdir inst_maps = do + +ppHtml title source_url ifaces odir maybe_css libdir inst_maps prologue = do let css_file = case maybe_css of Nothing -> libdir ++ pathSeparator:cssFile @@ -65,7 +67,7 @@ ppHtml title source_url ifaces odir maybe_css libdir inst_maps = do icon_contents <- readFile icon_file writeFile icon_destination icon_contents - ppHtmlContents odir title source_url (map fst visible_ifaces) + ppHtmlContents odir title source_url (map fst visible_ifaces) prologue ppHtmlIndex odir title visible_ifaces mapM_ (ppHtmlModule odir title source_url inst_maps) visible_ifaces @@ -151,9 +153,9 @@ moduleInfo iface -- --------------------------------------------------------------------------- -- Generate the module contents -ppHtmlContents :: FilePath -> String -> Maybe String -> [Module] +ppHtmlContents :: FilePath -> String -> Maybe String -> [Module] -> Maybe Doc -> IO () -ppHtmlContents odir title source_url mods = do +ppHtmlContents odir title source_url mods prologue = do let tree = mkModuleTree mods html = header (thetitle (toHtml title) +++ @@ -161,11 +163,19 @@ ppHtmlContents odir title source_url mods = do rel "stylesheet", thetype "text/css"]) +++ body << vanillaTable << ( simpleHeader title </> + ppPrologue prologue </> ppModuleTree title tree </> + s15 </> footer ) writeFile (odir ++ pathSeparator:contentsHtmlFile) (renderHtml html) +ppPrologue :: Maybe Doc -> HtmlTable +ppPrologue Nothing = Html.emptyTable +ppPrologue (Just doc) = + (tda [theclass "section1"] << toHtml "Description") </> + docBox (docToHtml doc) + ppModuleTree :: String -> [ModuleTree] -> HtmlTable ppModuleTree title ts = tda [theclass "section1"] << toHtml "Modules" </> |