aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockUtil.hs
diff options
context:
space:
mode:
authorkrasimir <unknown>2004-07-28 22:12:10 +0000
committerkrasimir <unknown>2004-07-28 22:12:10 +0000
commitc4fb4881fa80488d9939b52bf333c2ac89fd4c52 (patch)
tree3475a372759b7fbe0a546b165a6faa61ae912077 /src/HaddockUtil.hs
parenta5f1be23a47af7e12aff58a335d33fe184fa4cd0 (diff)
[haddock @ 2004-07-28 22:12:09 by krasimir]
bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs
Diffstat (limited to 'src/HaddockUtil.hs')
-rw-r--r--src/HaddockUtil.hs11
1 files changed, 11 insertions, 0 deletions
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