aboutsummaryrefslogtreecommitdiff
path: root/src/HaddockHtml.hs
diff options
context:
space:
mode:
authorkrasimir <unknown>2002-07-09 16:33:33 +0000
committerkrasimir <unknown>2002-07-09 16:33:33 +0000
commit9728087302a03143624d030642770f17be1eb097 (patch)
tree0744abe99116d9b9927ff2003f560429702ffe1f /src/HaddockHtml.hs
parent44f3891a021a5d10d2f5fc1263ac0633573d86a8 (diff)
[haddock @ 2002-07-09 16:33:31 by krasimir]
'Microsoft HTML Help' support
Diffstat (limited to 'src/HaddockHtml.hs')
-rw-r--r--src/HaddockHtml.hs30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index 209d9689..a503d50f 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -10,6 +10,8 @@ import Prelude hiding (div)
import HaddockVersion
import HaddockTypes
import HaddockUtil
+import HaddockModuleTree
+import HaddockHH
import HsSyn
import IO
@@ -69,12 +71,10 @@ ppHtml title source_url ifaces odir maybe_css libdir inst_maps prologue = do
ppHtmlContents odir title source_url (map fst visible_ifaces) prologue
ppHtmlIndex odir title visible_ifaces
+ ppHHContents odir (map fst visible_ifaces)
+ ppHHIndex odir visible_ifaces
mapM_ (ppHtmlModule odir title source_url inst_maps) visible_ifaces
-moduleHtmlFile :: FilePath -> String -> FilePath
-moduleHtmlFile "" mod = mod ++ ".html" -- ToDo: Z-encode filename?
-moduleHtmlFile dir mod = dir ++ pathSeparator : mod ++ ".html"
-
contentsHtmlFile = "index.html"
indexHtmlFile = "doc-index.html"
subIndexHtmlFile k a = "doc-index-" ++ k:a:".html"
@@ -198,28 +198,6 @@ mkLeaf s ss True = anchor ! [href (moduleHtmlFile "" mod)] << toHtml s
(s':ss') = reverse (s:ss)
-- reconstruct the module name
-data ModuleTree = Node String Bool [ModuleTree]
-
-mkModuleTree :: [Module] -> [ModuleTree]
-mkModuleTree mods = foldr addToTrees [] (map splitModule mods)
-
-addToTrees :: [String] -> [ModuleTree] -> [ModuleTree]
-addToTrees [] ts = ts
-addToTrees ss [] = mkSubTree ss
-addToTrees (s1:ss) (t@(Node s2 leaf subs) : ts)
- | s1 > s2 = t : addToTrees (s1:ss) ts
- | s1 == s2 = Node s2 (leaf || null ss) (addToTrees ss subs) : ts
- | otherwise = mkSubTree (s1:ss) ++ t : ts
-
-mkSubTree [] = []
-mkSubTree (s:ss) = [Node s (null ss) (mkSubTree ss)]
-
-splitModule :: Module -> [String]
-splitModule (Module mod) = split mod
- where split mod = case break (== '.') mod of
- (s1, '.':s2) -> s1 : split s2
- (s1, _) -> [s1]
-
-- ---------------------------------------------------------------------------
-- Generate the index