aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE35
-rw-r--r--CHANGES12
-rw-r--r--doc/haddock.xml2
-rw-r--r--haddock.cabal5
-rw-r--r--haddock.spec2
-rw-r--r--html/haddock-util.js37
-rw-r--r--src/Haddock/Backends/Xhtml.hs7
-rw-r--r--src/Haddock/Interface.hs9
-rw-r--r--src/Main.hs2
9 files changed, 80 insertions, 31 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index d06508c0..e56f341f 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,29 +1,28 @@
--------------------------------------------
--- Haddock 2.9.0
+-- Haddock 2.9.3
--------------------------------------------
A new version of Haddock, the Haskell documentation tool, is out!
-This version is compatible with .haddock files produced by the version of
-Haddock that comes with GHC 7.0.1.
+This is the version that comes with GHC 7.2.1 (although that executable claims
+it is version 2.9.2!)
+
+Apologies to people who have sent in patches that haven't made it into this
+release, they will go into the next one.
--------------------------------------------
--- Changes in version 2.9.0
+-- Changes in version 2.9.3
--------------------------------------------
-Changes in version 2.9.0
-
- * Drop support for ghc < 7
-
- * New flag --qual for qualification of names
+Changes in version 2.9.3
- * Print doc coverage information to stdout when generating docs
+ * Build with GHC 7.2.1
- * Include an 'All' option in the A-Z subdivided index
+ * Support blank lines in results of examples
- * Make TOC group header identifiers validate
+ * A type signatures for multiple names generates one signature in the output
- * Minor changes to the API
+ * Minor bug fixes
--------------------------------------------
-- Links
@@ -50,12 +49,12 @@ Code repository:
The following people contributed patches to this release:
-Tobias Brandt
-Mark Lentczner
+Max Bolingbroke
Ian Lynagh
-Simon Marlow
-Simon Michael
-Ryan Newton
+Simon Hengel
+Jose Pedro Magalhaes
+Simon Peyton Jones
+Michal Terepeta
David Waern
--------------------------------------------
diff --git a/CHANGES b/CHANGES
index 511ad0db..7f65c913 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,15 @@
+Changes in version 2.9.3
+
+ [This is the version that comes with GHC 7.2.1 although it claims it's 2.9.2!]
+
+ * Build with GHC 7.2.1
+
+ * Support blank lines in results of examples
+
+ * A type signature for multiple names generates one signature in the output
+
+ * Minor bug fixes
+
Changes in version 2.9.2
* Build with GHC 7.0.2
diff --git a/doc/haddock.xml b/doc/haddock.xml
index 9528dc90..d444be5f 100644
--- a/doc/haddock.xml
+++ b/doc/haddock.xml
@@ -21,7 +21,7 @@
<holder>Simon Marlow, David Waern</holder>
</copyright>
<abstract>
- <para>This document describes Haddock version 2.9.2, a Haskell
+ <para>This document describes Haddock version 2.9.3, a Haskell
documentation tool.</para>
</abstract>
</bookinfo>
diff --git a/haddock.cabal b/haddock.cabal
index de11e7f7..e767e397 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -1,5 +1,5 @@
name: haddock
-version: 2.9.2
+version: 2.9.3
cabal-version: >= 1.10
license: BSD3
build-type: Simple
@@ -48,6 +48,9 @@ extra-source-files:
haddock.spec
haskell.vim
src/haddock.sh
+-- The test files shouldn't have to go here, but the source files for
+-- the test-suite stanzas don't get picked up by `cabal sdist`.
+ tests/html-tests/runtests.hs
data-files:
html/frames.html
diff --git a/haddock.spec b/haddock.spec
index 973446c1..95617a37 100644
--- a/haddock.spec
+++ b/haddock.spec
@@ -17,7 +17,7 @@
# version label of your release tarball.
%define name haddock
-%define version 2.9.2
+%define version 2.9.3
%define release 1
Name: %{name}
diff --git a/html/haddock-util.js b/html/haddock-util.js
index 4a7e4255..9a6fccf7 100644
--- a/html/haddock-util.js
+++ b/html/haddock-util.js
@@ -50,11 +50,43 @@ toggleCollapser = makeClassToggle("collapser", "expander");
function toggleSection(id)
{
- var b = toggleShow(document.getElementById("section." + id))
- toggleCollapser(document.getElementById("control." + id), b)
+ var b = toggleShow(document.getElementById("section." + id));
+ toggleCollapser(document.getElementById("control." + id), b);
+ rememberCollapsed(id, b);
return b;
}
+var collapsed = {};
+function rememberCollapsed(id, b)
+{
+ if(b)
+ delete collapsed[id]
+ else
+ collapsed[id] = null;
+
+ var sections = [];
+ for(var i in collapsed)
+ {
+ if(collapsed.hasOwnProperty(i))
+ sections.push(i);
+ }
+ // cookie specific to this page; don't use setCookie which sets path=/
+ document.cookie = "collapsed=" + escape(sections.join('+'));
+}
+
+function restoreCollapsed()
+{
+ var cookie = getCookie("collapsed");
+ if(!cookie)
+ return;
+
+ var ids = cookie.split('+');
+ for(var i in ids)
+ {
+ if(document.getElementById("section." + ids[i]))
+ toggleSection(ids[i]);
+ }
+}
function setCookie(name, value) {
document.cookie = name + "=" + escape(value) + ";path=/;";
@@ -307,5 +339,6 @@ function pageLoad() {
addStyleMenu();
adjustForFrames();
resetStyle();
+ restoreCollapsed();
}
diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs
index 600a5362..b639760d 100644
--- a/src/Haddock/Backends/Xhtml.hs
+++ b/src/Haddock/Backends/Xhtml.hs
@@ -41,6 +41,7 @@ import System.FilePath hiding ( (</>) )
import System.Directory
import Data.Map ( Map )
import qualified Data.Map as Map hiding ( Map )
+import qualified Data.Set as Set hiding ( Set )
import Data.Function
import Data.Ord ( comparing )
@@ -415,9 +416,11 @@ ppHtmlIndex odir doctitle _maybe_package themes
getIfaceIndex iface =
[ (getOccString name
- , Map.fromList [(name, [(mdl, name `elem` instVisibleExports iface)])])
+ , Map.fromList [(name, [(mdl, name `Set.member` visible)])])
| name <- instExports iface ]
- where mdl = instMod iface
+ where
+ mdl = instMod iface
+ visible = Set.fromList (instVisibleExports iface)
indexElt :: (String, Map GHC.Name [(Module,Bool)]) -> HtmlTable
indexElt (str, entities) =
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index 276621d2..09f01883 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -142,6 +142,7 @@ createIfaces0 verbosity modules flags instIfaceMap =
createIfaces :: Verbosity -> [Flag] -> InstIfaceMap -> ModuleGraph -> Ghc [Interface]
createIfaces verbosity flags instIfaceMap mods = do
let sortedMods = flattenSCCs $ topSortModuleGraph False mods Nothing
+ out verbosity normal "Haddock coverage:"
(ifaces, _) <- foldM f ([], Map.empty) sortedMods
return (reverse ifaces)
where
@@ -162,11 +163,9 @@ processModule verbosity modsum flags modMap instIfaceMap = do
liftIO $ mapM_ putStrLn msg
let (haddockable, haddocked) = ifaceHaddockCoverage interface
percentage = round (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
- coveragemsg = printf "haddock coverage for %s: %7s %3d%%"
- (ifaceOrigFilename interface)
- (printf "%d/%d" haddocked haddockable :: String)
- percentage
- out verbosity normal coveragemsg
+ modString = moduleString (ifaceMod interface)
+ coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
+ out verbosity normal coverageMsg
interface' <- liftIO $ evaluate interface
return (Just interface')
else
diff --git a/src/Main.hs b/src/Main.hs
index 6e029b99..ba48a709 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -159,7 +159,7 @@ readPackagesAndProcessModules flags files = do
-- Catches all GHC source errors, then prints and re-throws them.
let handleSrcErrors action' = flip handleSourceError action' $ \err -> do
- printExceptionAndWarnings err
+ printException err
liftIO exitFailure
-- Initialize GHC.