diff options
author | davve <davve@dtek.chalmers.se> | 2006-08-09 20:04:56 +0000 |
---|---|---|
committer | davve <davve@dtek.chalmers.se> | 2006-08-09 20:04:56 +0000 |
commit | f04ce12191b5e95fdf944c1805ef4faccb36758d (patch) | |
tree | 15bad46e903627eab6a9a145c91788117eb3c585 /src/HaddockUtil.hs | |
parent | 7e00d4646b0ab3694cee32752d2a8bac04317446 (diff) |
More Html rendering progress
Diffstat (limited to 'src/HaddockUtil.hs')
-rw-r--r-- | src/HaddockUtil.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs index 99c814f4..b4121752 100644 --- a/src/HaddockUtil.hs +++ b/src/HaddockUtil.hs @@ -16,6 +16,7 @@ module HaddockUtil ( basename, dirname, splitFilename3, moduleHtmlFile, nameHtmlRef, contentsHtmlFile, indexHtmlFile, subIndexHtmlFile, pathJoin, + anchorNameStr, cssFile, iconFile, jsFile, plusFile, minusFile, -- * Miscellaneous utilities @@ -279,7 +280,7 @@ isPathSeparator ch = moduleHtmlFile :: String -> FilePath moduleHtmlFile mdl = - case Map.lookup (Module mdl) html_xrefs of + case Map.lookup (GHC.mkModule mdl) html_xrefs of Nothing -> mdl' ++ ".html" Just fp0 -> pathJoin [fp0, mdl' ++ ".html"] where @@ -288,11 +289,6 @@ moduleHtmlFile mdl = nameHtmlRef :: String -> GHC.Name -> String nameHtmlRef mdl str = moduleHtmlFile mdl ++ '#':escapeStr (anchorNameStr str) -anchorNameStr :: GHC.Name -> String -anchorNameStr name | isValOcc occName = "v:" ++ getOccString name - | otherwise = "t:" ++ getOccString name - where occName = nameOccName name - contentsHtmlFile, indexHtmlFile :: String contentsHtmlFile = "index.html" indexHtmlFile = "doc-index.html" @@ -302,6 +298,11 @@ subIndexHtmlFile a = "doc-index-" ++ b ++ ".html" where b | isAlpha a = [a] | otherwise = show (ord a) +anchorNameStr :: Name -> String +anchorNameStr name | isValOcc occName = "v:" ++ getOccString name + | otherwise = "t:" ++ getOccString name + where occName = nameOccName name + pathJoin :: [FilePath] -> FilePath pathJoin = foldr join [] where join :: FilePath -> FilePath -> FilePath @@ -368,11 +369,11 @@ escapeStr = escapeURIString isUnreserved -- being I'm going to use a write-once global variable. {-# NOINLINE html_xrefs_ref #-} -html_xrefs_ref :: IORef (Map Module FilePath) +html_xrefs_ref :: IORef (Map GHC.Module FilePath) html_xrefs_ref = unsafePerformIO (newIORef (error "module_map")) {-# NOINLINE html_xrefs #-} -html_xrefs :: Map Module FilePath +html_xrefs :: Map GHC.Module FilePath html_xrefs = unsafePerformIO (readIORef html_xrefs_ref) ----------------------------------------------------------------------------- |