aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2008-10-20 21:13:24 +0000
committerDavid Waern <david.waern@gmail.com>2008-10-20 21:13:24 +0000
commit6540f377aa3aae38fb397b0353a7637b20767340 (patch)
treea91ebbb700008ab3b24433ab4b16c0e403960851
parentf8a9a5dddd823dccf9e1ba723f0f2c500e4cc6a9 (diff)
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.
-rw-r--r--src/Main.hs11
1 files changed, 5 insertions, 6 deletions
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