diff options
author | krasimir <unknown> | 2004-08-01 19:52:08 +0000 |
---|---|---|
committer | krasimir <unknown> | 2004-08-01 19:52:08 +0000 |
commit | fd7cc6bc85c5d3b016b3554d03957d14dce3c6d2 (patch) | |
tree | d52b605a9dd737522d47a48ad1ef598f9d08f5d4 /src/HaddockUtil.hs | |
parent | 790fe21eec05d57e400909c218d749a24ae1a63a (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/HaddockUtil.hs')
-rw-r--r-- | src/HaddockUtil.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index 03796532..f7dab157 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -23,7 +23,7 @@ module HaddockUtil ( getProgramName, bye, die, dieMsg, mapSnd, mapMaybeM, escapeStr, -- * HTML cross reference mapping - html_xrefs_ref, html_xrefs, + html_xrefs_ref, ) where import HsSyn @@ -272,12 +272,14 @@ isPathSeparator ch = ch == '/' #endif -moduleHtmlFile :: FilePath -> String -> FilePath -moduleHtmlFile "" mod0 = mod0 ++ ".html" -- ToDo: Z-encode filename? -moduleHtmlFile dir mod0 = dir ++ pathSeparator : mod0 ++ ".html" +moduleHtmlFile :: String -> FilePath +moduleHtmlFile mdl = + case lookupFM html_xrefs (Module mdl) of + Nothing -> mdl ++ ".html" + Just fp0 -> fp0 ++ pathSeparator : mdl ++ ".html" -nameHtmlRef :: FilePath -> String -> HsName -> String -nameHtmlRef fp mdl str = moduleHtmlFile fp mdl ++ '#':escapeStr (hsAnchorNameStr str) +nameHtmlRef :: String -> HsName -> String +nameHtmlRef mdl str = moduleHtmlFile mdl ++ '#':escapeStr (hsAnchorNameStr str) contentsHtmlFile, indexHtmlFile :: String contentsHtmlFile = "index.html" |