aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockHH.hs
diff options
context:
space:
mode:
authorkrasimir <unknown>2004-08-01 19:52:08 +0000
committerkrasimir <unknown>2004-08-01 19:52:08 +0000
commitfd7cc6bc85c5d3b016b3554d03957d14dce3c6d2 (patch)
treed52b605a9dd737522d47a48ad1ef598f9d08f5d4 /src/HaddockHH.hs
parent790fe21eec05d57e400909c218d749a24ae1a63a (diff)
[haddock @ 2004-08-01 19:52:06 by krasimir]
fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format.
Diffstat (limited to 'src/HaddockHH.hs')
-rw-r--r--src/HaddockHH.hs29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs
index 98dac72a..6a41f738 100644
--- a/src/HaddockHH.hs
+++ b/src/HaddockHH.hs
@@ -61,7 +61,7 @@ ppHHContents odir maybe_package tree = do
text "<LI>" <> nest 4
(text "<OBJECT type=\"text/sitemap\">" $$
text "<PARAM name=\"Name\" value=\"" <> text s <> text "\">" $$
- (if isleaf then text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile "" mdl) <> text "\">" else empty) $$
+ (if isleaf then text "<PARAM name=\"Local\" value=\"" <> text (moduleHtmlFile mdl) <> text "\">" else empty) $$
text "</OBJECT>") $+$
text "</LI>"
where
@@ -107,12 +107,12 @@ ppHHIndex odir maybe_package ifaces = do
ppReference name [] = empty
ppReference name (Module mdl:refs) =
- text "<PARAM name=\"Local\" value=\"" <> text (nameHtmlRef "" mdl name) <> text "\">" $$
+ text "<PARAM name=\"Local\" value=\"" <> text (nameHtmlRef mdl name) <> text "\">" $$
ppReference name refs
-ppHHProject :: FilePath -> String -> Maybe String -> [(Module,Interface)] -> IO ()
-ppHHProject odir doctitle maybe_package ifaces = do
+ppHHProject :: FilePath -> String -> Maybe String -> [(Module,Interface)] -> [FilePath] -> IO ()
+ppHHProject odir doctitle maybe_package ifaces pkg_paths = do
let projectHHFile = package++".hhp"
doc =
text "[OPTIONS]" $$
@@ -129,24 +129,33 @@ ppHHProject odir doctitle maybe_package ifaces = do
text contentsHtmlFile $$
text indexHtmlFile $$
ppIndexFiles chars $$
- text cssFile $$
- text iconFile $$
- text jsFile $$
- text plusFile $$
- text minusFile
+ ppLibFiles ("":pkg_paths)
writeFile (odir ++ pathSeparator:projectHHFile) (render doc)
where
package = fromMaybe "pkg" maybe_package
ppMods [] = empty
ppMods ((Module mdl,_):ifaces) =
- text (moduleHtmlFile "" mdl) $$
+ text (moduleHtmlFile mdl) $$
ppMods ifaces
ppIndexFiles [] = empty
ppIndexFiles (c:cs) =
text (subIndexHtmlFile c) $$
ppIndexFiles cs
+
+ ppLibFiles [] = empty
+ ppLibFiles (path:paths) =
+ ppLibFile cssFile $$
+ ppLibFile iconFile $$
+ ppLibFile jsFile $$
+ ppLibFile plusFile $$
+ ppLibFile minusFile $$
+ ppLibFiles paths
+ where
+ toPath fname | null path = fname
+ | otherwise = path++pathSeparator:fname
+ ppLibFile fname = text (toPath fname)
chars :: [Char]
chars = keysFM (foldr getIfaceIndex emptyFM ifaces)