From 6540f377aa3aae38fb397b0353a7637b20767340 Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 20 Oct 2008 21:13:24 +0000 Subject: Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. --- src/Main.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index fb1c54fd..75482481 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -191,11 +191,13 @@ main = handleTopExceptions $ do -- create the interfaces -- this is the core part of Haddock (interfaces, homeLinks) <- createInterfaces session fileArgs extLinks flags + let visibleIfaces = [ i | i <- interfaces, OptHide `notElem` ifaceOptions i ] + -- render the interfaces - renderStep packages interfaces + renderStep packages visibleIfaces -- last but not least, dump the interface file - dumpInterfaceFile (map toInstalledIface interfaces) homeLinks flags + dumpInterfaceFile (map toInstalledIface visibleIfaces) homeLinks flags #endif else do -- get packages supplied with --read-interface @@ -212,7 +214,7 @@ main = handleTopExceptions $ do -- | Render the interfaces with whatever backend is specified in the flags render :: [Flag] -> [Interface] -> [InstalledInterface] -> IO () -render flags interfaces installedIfaces = do +render flags visibleIfaces installedIfaces = do let title = case [str | Flag_Heading str <- flags] of [] -> "" @@ -267,9 +269,6 @@ render flags interfaces installedIfaces = do prologue <- getPrologue flags let - -- visible home-module interfaces - visibleIfaces = [ m | m <- interfaces, OptHide `notElem` (ifaceOptions m) ] - -- *all* visible interfaces including external package modules allVisibleIfaces = map toInstalledIface visibleIfaces ++ installedIfaces -- cgit v1.2.3