From db6d762f755e94540ce1d42e03c4fde8f26cb4c2 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 6 Nov 2003 16:48:14 +0000 Subject: [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. --- src/Binary.hs | 19 +++++++++++++++++ src/HaddockHH.hs | 6 +++--- src/HaddockHtml.hs | 53 ++++++++++++++++++++++++++++++------------------ src/HaddockModuleTree.hs | 32 +++++++++++++++++------------ src/HaddockTypes.hs | 2 ++ src/Main.hs | 39 +++++++++++++++++++++++------------ 6 files changed, 102 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/Binary.hs b/src/Binary.hs index 07180a8a..2703439a 100644 --- a/src/Binary.hs +++ b/src/Binary.hs @@ -474,6 +474,25 @@ instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,b,c,d) where d <- get bh return (a,b,c,d) +instance (Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a,b,c,d,e) where + put_ bh (a,b,c,d,e) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e + get bh = do a <- get bh + b <- get bh + c <- get bh + d <- get bh + e <- get bh + return (a,b,c,d,e) + +instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a,b,c,d,e,f) where + put_ bh (a,b,c,d,e,f) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e; put_ bh f + get bh = do a <- get bh + b <- get bh + c <- get bh + d <- get bh + e <- get bh + f <- get bh + return (a,b,c,d,e,f) + instance Binary a => Binary (Maybe a) where put_ bh Nothing = putByte bh 0 put_ bh (Just a) = do putByte bh 1; put_ bh a diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs index 9357c00c..f10c970e 100644 --- a/src/HaddockHH.hs +++ b/src/HaddockHH.hs @@ -20,7 +20,7 @@ indexHHFile = "index.hhk" ppHHContents :: FilePath -> [Module] -> IO () ppHHContents odir mods = do - let tree = mkModuleTree mods + let tree = mkModuleTree (zip mods (repeat Nothing)) --TODO: packages html = text "" $$ text "" $$ @@ -47,9 +47,9 @@ ppHHContents odir mods = do fn _ [] = error "HaddockHH.ppHHContents.fn: no module trees given" ppNode :: [String] -> ModuleTree -> Doc - ppNode ss (Node s leaf []) = + ppNode ss (Node s leaf _pkg []) = ppLeaf s ss leaf - ppNode ss (Node s leaf ts) = + ppNode ss (Node s leaf _pkg ts) = ppLeaf s ss leaf $$ text "