diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HaddockHH2.hs | 6 | ||||
-rw-r--r-- | src/HaddockHtml.hs | 12 | ||||
-rw-r--r-- | src/HaddockUtil.hs | 11 |
3 files changed, 15 insertions, 14 deletions
diff --git a/src/HaddockHH2.hs b/src/HaddockHH2.hs index 1e4de522..2fb673b9 100644 --- a/src/HaddockHH2.hs +++ b/src/HaddockHH2.hs @@ -111,8 +111,8 @@ ppHH2Files odir package ifaces = do text "<!DOCTYPE HelpFileList SYSTEM \"ms-help://hx/resources/HelpFileList.DTD\">" $$
text "<HelpFileList DTDVersion=\"1.0\">" $$
nest 4 (ppMods ifaces $$
- text "<File Url=\"index.html\"/>" $$
- text "<File Url=\"doc-index.html\"/>" $$
+ text "<File Url=\""<>text contentsHtmlFile<>text "\"/>" $$
+ text "<File Url=\""<>text indexHtmlFile<>text "\"/>" $$
ppIndexFiles chars $$
text "<File Url=\""<>text cssFile <>text "\"/>") $$
text "<File Url=\""<>text iconFile <>text "\"/>" $$
@@ -129,7 +129,7 @@ ppHH2Files odir package ifaces = do ppIndexFiles [] = empty ppIndexFiles (c:cs) = - text "<File Url=\"doc-index-" <> char c <> text ".html\"/>" $$
+ text "<File Url=\""<>text (subIndexHtmlFile c)<>text "\"/>" $$
ppIndexFiles cs chars :: [Char] diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index 0f700f24..523f65b5 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -21,7 +21,7 @@ import HsSyn import IO import Maybe ( fromJust, isJust, fromMaybe ) import List ( sortBy ) -import Char ( isUpper, toUpper, isAlpha, ord ) +import Char ( isUpper, toUpper ) import Monad ( when, unless ) #if __GLASGOW_HASKELL__ < 503 @@ -97,16 +97,6 @@ copyHtmlBits odir libdir maybe_css = do writeFile css_destination css_contents mapM_ copyFile [ iconFile, plusFile, minusFile, jsFile ] - -contentsHtmlFile, indexHtmlFile :: String -contentsHtmlFile = "index.html" -indexHtmlFile = "doc-index.html" - -subIndexHtmlFile :: Char -> String -subIndexHtmlFile a = "doc-index-" ++ b ++ ".html" - where b | isAlpha a = [a] - | otherwise = show (ord a) - footer :: HtmlTable footer = tda [theclass "botbar"] << diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index 5ce61011..eca9e743 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -16,6 +16,7 @@ module HaddockUtil ( basename, dirname, splitFilename3, isPathSeparator, pathSeparator, moduleHtmlFile, nameHtmlRef, + contentsHtmlFile, indexHtmlFile, subIndexHtmlFile, cssFile, iconFile, jsFile, plusFile, minusFile, -- * Miscellaneous utilities @@ -33,6 +34,7 @@ import IO ( hPutStr, stderr ) import System import Binary import Monad +import Char ( isAlpha, ord ) #if __GLASGOW_HASKELL__ < 503 import RegexString @@ -277,6 +279,15 @@ moduleHtmlFile dir mod0 = dir ++ pathSeparator : mod0 ++ ".html" nameHtmlRef :: FilePath -> String -> HsName -> String nameHtmlRef fp mdl str = moduleHtmlFile fp mdl ++ '#':escapeStr (hsAnchorNameStr str) +contentsHtmlFile, indexHtmlFile :: String +contentsHtmlFile = "index.html" +indexHtmlFile = "doc-index.html" + +subIndexHtmlFile :: Char -> String +subIndexHtmlFile a = "doc-index-" ++ b ++ ".html" + where b | isAlpha a = [a] + | otherwise = show (ord a) + -- ----------------------------------------------------------------------------- -- Files we need to copy from our $libdir |