aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--doc/invoking.rst8
-rw-r--r--doc/markup.rst17
-rw-r--r--ghc.mk1
-rw-r--r--haddock-api/haddock-api.cabal3
-rw-r--r--haddock-api/resources/html/Ocean.std-theme/ocean.css2
-rw-r--r--haddock-api/resources/html/frames.html30
-rw-r--r--haddock-api/resources/html/haddock-util.js28
-rw-r--r--haddock-api/src/Haddock.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml.hs58
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs19
-rw-r--r--haddock-api/src/Haddock/Interface/ParseModuleHeader.hs2
-rw-r--r--haddock-api/src/Haddock/Types.hs2
-rw-r--r--haddock-api/src/Haddock/Utils.hs12
-rw-r--r--haddock-library/haddock-library.cabal2
-rw-r--r--haddock-library/src/Documentation/Haddock/Parser/Monad.hs2
-rwxr-xr-xhaddock-test/Setup.lhs3
-rw-r--r--haddock-test/haddock-test.cabal2
-rw-r--r--haddock.cabal10
-rw-r--r--html-test/ref/Bug280.html81
-rw-r--r--html-test/ref/Test.html2
-rw-r--r--html-test/ref/frames.html30
-rw-r--r--html-test/ref/haddock-util.js28
-rw-r--r--html-test/src/Bug280.hs11
24 files changed, 164 insertions, 195 deletions
diff --git a/CHANGES b/CHANGES
index d450cff5..4389c58a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+Changes in version 2.17.3
+
+ * Remove framed view of the HTML documentation
+
Changes in version 2.17.2
* Fix portability of documentation building within GHC
diff --git a/doc/invoking.rst b/doc/invoking.rst
index 13cb9f1e..83087bac 100644
--- a/doc/invoking.rst
+++ b/doc/invoking.rst
@@ -100,7 +100,7 @@ The following options are available:
``module.html``; ``mini_module.html``
An HTML page for each module, and a "mini" page for each used
- when viewing in frames.
+ when viewing their synopsis.
``index.html``
The top level page of the documentation: lists the modules
@@ -111,17 +111,13 @@ The following options are available:
The alphabetic index, possibly split into multiple pages if big
enough.
- ``frames.html``
- The top level document when viewing in frames.
-
``some.css``; ``etc...``
Files needed for the themes used. Specify your themes using the
:option:`--theme` option.
``haddock-util.js``
Some JavaScript utilities used to implement some of the dynamic
- features like collapsible sections, and switching to frames
- view.
+ features like collapsible sections.
.. option:: --latex
diff --git a/doc/markup.rst b/doc/markup.rst
index a2274ad6..b0ebc738 100644
--- a/doc/markup.rst
+++ b/doc/markup.rst
@@ -501,7 +501,7 @@ Special characters
~~~~~~~~~~~~~~~~~~
The following characters have special meanings in documentation
-comments: ``\\``, ``/``, ``'``, ``\```, ``"``, ``@``, ``<``. To insert a
+comments: ``\\``, ``/``, ``'``, ``\```, ``"``, ``@``, ``<``, ``$``. To insert a
literal occurrence of one of these special characters, precede it with a
backslash (``\\``).
@@ -799,6 +799,21 @@ If the output format supports it, the image will be rendered inside the
documentation. The image description is used as relpacement text and/or
image title.
+Mathematics / LaTeX
+~~~~~~~~~~~~~~~~~~~
+
+Haddock supports LaTeX syntax for rendering mathematical notation. The
+delimiters are ``\[...\]`` for displayed mathematics and ``\(...\)``
+for in-line mathematics. An example looks like this: ::
+
+ \[
+ f(a) = \frac{1}{2\pi i}\oint_\gamma \frac{f(z)}{z-a}\,\mathrm{d}z
+ \]
+
+If the output format supports it, the mathematics will be rendered
+inside the documentation. For example, the HTML backend will display
+the mathematics via `MathJax <https://www.mathjax.org>`__.
+
Anchors
~~~~~~~
diff --git a/ghc.mk b/ghc.mk
index 72ba5df1..9226d027 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -36,7 +36,6 @@ endif
utils/haddock_dist_MODULES += Paths_haddock
-utils/haddock_dist_DATA_FILES += html/frames.html
utils/haddock_dist_DATA_FILES += html/haddock-util.js
utils/haddock_dist_DATA_FILES += html/Classic.theme/haskell_icon.gif
utils/haddock_dist_DATA_FILES += html/Classic.theme/minus.gif
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 2ddd97cb..620fd981 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -1,5 +1,5 @@
name: haddock-api
-version: 2.17.2
+version: 2.17.3
synopsis: A documentation-generation tool for Haskell libraries
description: Haddock is a documentation-generation tool for Haskell
libraries
@@ -19,7 +19,6 @@ data-dir:
resources
data-files:
html/solarized.css
- html/frames.html
html/haddock-util.js
html/highlight.js
html/Classic.theme/haskell_icon.gif
diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css
index 3ebb14de..e8e4d705 100644
--- a/haddock-api/resources/html/Ocean.std-theme/ocean.css
+++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css
@@ -333,6 +333,8 @@ div#style-menu-holder {
top: 10%;
padding: 0;
max-width: 75%;
+ /* Ensure that synopsis covers everything (including MathJAX markup) */
+ z-index: 1;
}
#synopsis .caption {
diff --git a/haddock-api/resources/html/frames.html b/haddock-api/resources/html/frames.html
deleted file mode 100644
index e86edb66..00000000
--- a/haddock-api/resources/html/frames.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title></title>
-<script src="haddock-util.js" type="text/javascript"></script>
-<script type="text/javascript"><!--
-/*
-
- The synopsis frame needs to be updated using javascript, so we hide
- it by default and only show it if javascript is enabled.
-
- TODO: provide some means to disable it.
-*/
-function load() {
- var d = document.getElementById("inner-fs");
- d.rows = "50%,50%";
- postReframe();
-}
---></script>
-</head>
-<frameset id="outer-fs" cols="25%,75%" onload="load()">
- <frameset id="inner-fs" rows="100%,0%">
- <frame src="index-frames.html" name="modules" />
- <frame src="" name="synopsis" />
- </frameset>
- <frame src="index.html" name="main" />
-</frameset>
-</html>
diff --git a/haddock-api/resources/html/haddock-util.js b/haddock-api/resources/html/haddock-util.js
index fc7743fe..92d07d2a 100644
--- a/haddock-api/resources/html/haddock-util.js
+++ b/haddock-api/resources/html/haddock-util.js
@@ -248,33 +248,6 @@ function addMenuItem(html) {
}
}
-function adjustForFrames() {
- var bodyCls;
-
- if (parent.location.href == window.location.href) {
- // not in frames, so add Frames button
- addMenuItem("<a href='#' onclick='reframe();return true;'>Frames</a>");
- bodyCls = "no-frame";
- }
- else {
- bodyCls = "in-frame";
- }
- addClass(document.body, bodyCls);
-}
-
-function reframe() {
- setCookie("haddock-reframe", document.URL);
- window.location = "frames.html";
-}
-
-function postReframe() {
- var s = getCookie("haddock-reframe");
- if (s) {
- parent.window.main.location = s;
- clearCookie("haddock-reframe");
- }
-}
-
function styles() {
var i, a, es = document.getElementsByTagName("link"), rs = [];
for (i = 0; a = es[i]; i++) {
@@ -337,7 +310,6 @@ function styleMenu(show) {
function pageLoad() {
addStyleMenu();
- adjustForFrames();
resetStyle();
restoreCollapsed();
}
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 83136df6..bbaea359 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -335,7 +335,7 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do
ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style
libDir
- when (Flag_HyperlinkedSource `elem` flags) $ do
+ when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do
ppHyperlinkedSource odir libDir opt_source_css pretty srcMap ifaces
-- | From GHC 7.10, this function has a potential to crash with a
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 9fd55e49..65b427f9 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -35,15 +35,14 @@ import Text.XHtml hiding ( name, title, p, quote )
import Haddock.GhcUtils
import Control.Monad ( when, unless )
-import Data.Char ( toUpper )
-import Data.List ( sortBy, groupBy, intercalate, isPrefixOf )
+import Data.Char ( toUpper, isSpace )
+import Data.List ( sortBy, intercalate, isPrefixOf, intersperse )
import Data.Maybe
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 )
import DynFlags (Language(..))
@@ -105,7 +104,8 @@ copyHtmlBits odir libdir themes = do
copyCssFile f = copyFile f (combine odir (takeFileName f))
copyLibFile f = copyFile (joinPath [libhtmldir, f]) (joinPath [odir, f])
mapM_ copyCssFile (cssFiles themes)
- mapM_ copyLibFile [ jsFile, framesFile ]
+ copyLibFile jsFile
+ return ()
headHtml :: String -> Maybe String -> Themes -> Maybe String -> Html
@@ -201,8 +201,7 @@ moduleInfo iface =
field info >>= \a -> return (th << fieldName <-> td << a)
entries :: [HtmlTable]
- entries = mapMaybe doOneEntry [
- ("Copyright",hmi_copyright),
+ entries = maybeToList copyrightsTable ++ mapMaybe doOneEntry [
("License",hmi_license),
("Maintainer",hmi_maintainer),
("Stability",hmi_stability),
@@ -216,6 +215,14 @@ moduleInfo iface =
Just Haskell98 -> Just "Haskell98"
Just Haskell2010 -> Just "Haskell2010"
+ multilineRow :: String -> [String] -> HtmlTable
+ multilineRow title xs = (th ! [valign "top"]) << title <-> td << (toLines xs)
+ where toLines = mconcat . intersperse br . map toHtml
+
+ copyrightsTable :: Maybe HtmlTable
+ copyrightsTable = fmap (multilineRow "Copyright" . split) (hmi_copyright info)
+ where split = map (trim . filter (/= ',')) . lines
+
extsForm
| OptShowExtensions `elem` ifaceOptions iface =
let fs = map (dropOpt . show) (hmi_extensions info)
@@ -268,9 +275,6 @@ ppHtmlContents dflags odir doctitle _maybe_package
createDirectoryIfMissing True odir
writeFile (joinPath [odir, contentsHtmlFile]) (renderToString debug html)
- -- XXX: think of a better place for this?
- ppHtmlContentsFrame odir doctitle themes mathjax_url ifaces debug
-
ppPrologue :: Qualification -> String -> Maybe (MDoc GHC.RdrName) -> Html
ppPrologue _ _ Nothing = noHtml
@@ -321,39 +325,6 @@ mkNode qual ss p (Node s leaf pkg srcPkg short ts) =
subtree = mkNodeList qual (s:ss) p ts ! collapseSection p True ""
--- | Turn a module tree into a flat list of full module names. E.g.,
--- @
--- A
--- +-B
--- +-C
--- @
--- becomes
--- @["A", "A.B", "A.B.C"]@
-flatModuleTree :: [InstalledInterface] -> [Html]
-flatModuleTree ifaces =
- map (uncurry ppModule' . head)
- . groupBy ((==) `on` fst)
- . sortBy (comparing fst)
- $ mods
- where
- mods = [ (moduleString mdl, mdl) | mdl <- map instMod ifaces ]
- ppModule' txt mdl =
- anchor ! [href (moduleHtmlFile mdl), target mainFrameName]
- << toHtml txt
-
-
-ppHtmlContentsFrame :: FilePath -> String -> Themes -> Maybe String
- -> [InstalledInterface] -> Bool -> IO ()
-ppHtmlContentsFrame odir doctitle themes maybe_mathjax_url ifaces debug = do
- let mods = flatModuleTree ifaces
- html =
- headHtml doctitle Nothing themes maybe_mathjax_url +++
- miniBody << divModuleList <<
- (sectionName << "Modules" +++
- ulist << [ li ! [theclass "module"] << m | m <- mods ])
- createDirectoryIfMissing True odir
- writeFile (joinPath [odir, frameIndexHtmlFile]) (renderToString debug html)
-
--------------------------------------------------------------------------------
-- * Generate the index
@@ -684,6 +655,9 @@ processDecl :: Bool -> Html -> Maybe Html
processDecl True = Just
processDecl False = Just . divTopDecl
+trim :: String -> String
+trim = f . f
+ where f = reverse . dropWhile isSpace
processDeclOneLiner :: Bool -> Html -> Maybe Html
processDeclOneLiner True = Just
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 4a65fc2a..c8e6b982 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -36,7 +36,6 @@ import Control.Arrow (second)
import Control.DeepSeq
import Control.Monad
import Data.Function (on)
-import qualified Data.Foldable as F
import qualified Packages
import qualified Module
@@ -50,7 +49,7 @@ import TcRnTypes
import FastString (concatFS)
import BasicTypes ( StringLiteral(..), SourceText(..) )
import qualified Outputable as O
-import HsDecls ( gadtDeclDetails,getConDetails )
+import HsDecls ( getConDetails )
-- | Use a 'TypecheckedModule' to produce an 'Interface'.
-- To do this, we need access to already processed modules in the topological
@@ -796,13 +795,21 @@ extractDecl name mdl decl
| otherwise =
case unLoc decl of
TyClD d@ClassDecl {} ->
- let matches = [ sig | sig <- tcdSigs d, name `elem` sigName sig,
- isTypeLSig sig ] -- TODO: document fixity
+ let matches = [ lsig
+ | lsig <- tcdSigs d
+ , ClassOpSig False _ _ <- pure $ unLoc lsig
+ -- Note: exclude `default` declarations (see #505)
+ , name `elem` sigName lsig
+ ]
+ -- TODO: document fixity
in case matches of
[s0] -> let (n, tyvar_names) = (tcdName d, tyClDeclTyVars d)
L pos sig = addClassContext n tyvar_names s0
in L pos (SigD sig)
- _ -> error "internal: extractDecl (ClassDecl)"
+ _ -> O.pprPanic "extractDecl" (O.text "Ambiguous decl for" O.<+> O.ppr name O.<+> O.text "in class:"
+ O.$$ O.nest 4 (O.ppr d)
+ O.$$ O.text "Matches:"
+ O.$$ O.nest 4 (O.ppr matches))
TyClD d@DataDecl {} ->
let (n, tyvar_tys) = (tcdName d, lHsQTyVarsToTypes (tyClDeclTyVars d))
in SigD <$> extractRecSel name mdl n tyvar_tys (dd_cons (tcdDataDefn d))
@@ -837,7 +844,7 @@ extractRecSel nm mdl t tvs (L _ con : rest) =
matching_fields flds = [ (l,f) | f@(L _ (ConDeclField ns _ _)) <- flds
, L l n <- ns, selectorFieldOcc n == nm ]
data_ty
- -- | ResTyGADT _ ty <- con_res con = ty
+ -- ResTyGADT _ ty <- con_res con = ty
| ConDeclGADT{} <- con = hsib_body $ con_type con
| otherwise = foldl' (\x y -> noLoc (HsAppTy x y)) (noLoc (HsTyVar NotPromoted (noLoc t))) tvs
diff --git a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs
index e7d2a085..768a31ce 100644
--- a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs
+++ b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs
@@ -76,7 +76,7 @@ parseKey :: String -> String -> Maybe (String,String)
parseKey key toParse0 =
do
let
- (spaces0,toParse1) = extractLeadingSpaces toParse0
+ (spaces0,toParse1) = extractLeadingSpaces (dropWhile (`elem` ['\r', '\n']) toParse0)
indentation = spaces0
afterKey0 <- extractPrefix key toParse1
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 1f446224..8addfa2f 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -2,7 +2,9 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
-- in module GHC.PlaceHolder
+
{-# OPTIONS_GHC -fno-warn-orphans #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Types
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs
index ba382600..404cfcf6 100644
--- a/haddock-api/src/Haddock/Utils.hs
+++ b/haddock-api/src/Haddock/Utils.hs
@@ -21,10 +21,9 @@ module Haddock.Utils (
-- * Filename utilities
moduleHtmlFile, moduleHtmlFile',
contentsHtmlFile, indexHtmlFile,
- frameIndexHtmlFile,
moduleIndexFrameName, mainFrameName, synopsisFrameName,
subIndexHtmlFile,
- jsFile, framesFile,
+ jsFile,
-- * Anchor and URL utilities
moduleNameUrl, moduleNameUrl', moduleUrl,
@@ -262,12 +261,6 @@ contentsHtmlFile = "index.html"
indexHtmlFile = "doc-index.html"
--- | The name of the module index file to be displayed inside a frame.
--- Modules are display in full, but without indentation. Clicking opens in
--- the main window.
-frameIndexHtmlFile :: String
-frameIndexHtmlFile = "index-frames.html"
-
moduleIndexFrameName, mainFrameName, synopsisFrameName :: String
moduleIndexFrameName = "modules"
@@ -333,9 +326,8 @@ makeAnchorId (f:r) = escape isAlpha f ++ concatMap (escape isLegal) r
-------------------------------------------------------------------------------
-jsFile, framesFile :: String
+jsFile :: String
jsFile = "haddock-util.js"
-framesFile = "frames.html"
-------------------------------------------------------------------------------
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index 96992f04..cabfbc67 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -1,5 +1,5 @@
name: haddock-library
-version: 1.4.1
+version: 1.4.2
synopsis: Library exposing some functionality of Haddock.
description: Haddock is a documentation-generation tool for Haskell
libraries. These modules expose some functionality of it
diff --git a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs
index a421c58c..3f7d60f8 100644
--- a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs
+++ b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs
@@ -42,7 +42,7 @@ import Data.Tuple
import Documentation.Haddock.Types (Version)
-data ParserState = ParserState {
+newtype ParserState = ParserState {
parserStateSince :: Maybe Version
} deriving (Eq, Show)
diff --git a/haddock-test/Setup.lhs b/haddock-test/Setup.lhs
new file mode 100755
index 00000000..5bde0de9
--- /dev/null
+++ b/haddock-test/Setup.lhs
@@ -0,0 +1,3 @@
+#!/usr/bin/env runhaskell
+> import Distribution.Simple
+> main = defaultMain
diff --git a/haddock-test/haddock-test.cabal b/haddock-test/haddock-test.cabal
index 2b75ea81..7cb15d7d 100644
--- a/haddock-test/haddock-test.cabal
+++ b/haddock-test/haddock-test.cabal
@@ -16,7 +16,7 @@ library
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: src
- build-depends: base, bytestring, directory, process, filepath, Cabal, xml, xhtml, syb
+ build-depends: base >= 4.3 && < 4.10, bytestring, directory, process, filepath, Cabal, xml, xhtml, syb
exposed-modules:
Test.Haddock
diff --git a/haddock.cabal b/haddock.cabal
index 10460526..6ebdad76 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -1,5 +1,5 @@
name: haddock
-version: 2.17.2
+version: 2.17.3
synopsis: A documentation-generation tool for Haskell libraries
description: Haddock is a documentation-generation tool for Haskell
libraries
@@ -133,14 +133,14 @@ test-suite html-test
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: html-test
- build-depends: base, filepath, haddock-test
+ build-depends: base, filepath, haddock-test == 0.0.1
test-suite hypsrc-test
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: hypsrc-test
- build-depends: base, filepath, haddock-test
+ build-depends: base, filepath, haddock-test == 0.0.1
ghc-options: -Wall -fwarn-tabs
test-suite latex-test
@@ -148,14 +148,14 @@ test-suite latex-test
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: latex-test
- build-depends: base, filepath, haddock-test
+ build-depends: base, filepath, haddock-test == 0.0.1
test-suite hoogle-test
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: Main.hs
hs-source-dirs: hoogle-test
- build-depends: base, filepath, haddock-test
+ build-depends: base, filepath, haddock-test == 0.0.1
source-repository head
type: git
diff --git a/html-test/ref/Bug280.html b/html-test/ref/Bug280.html
new file mode 100644
index 00000000..92eb61b0
--- /dev/null
+++ b/html-test/ref/Bug280.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+><head
+ ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
+ /><title
+ >Bug280</title
+ ><link href="#" rel="stylesheet" type="text/css" title="Ocean"
+ /><script src="haddock-util.js" type="text/javascript"
+ ></script
+ ><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"
+ ></script
+ ><script type="text/javascript"
+ >//<![CDATA[
+window.onload = function () {pageLoad();setSynopsis("mini_Bug280.html");};
+//]]>
+</script
+ ></head
+ ><body
+ ><div id="package-header"
+ ><ul class="links" id="page-menu"
+ ><li
+ ><a href="#"
+ >Contents</a
+ ></li
+ ><li
+ ><a href="#"
+ >Index</a
+ ></li
+ ></ul
+ ><p class="caption empty"
+ >&nbsp;</p
+ ></div
+ ><div id="content"
+ ><div id="module-header"
+ ><table class="info"
+ ><tr
+ ><th valign="top"
+ >Copyright</th
+ ><td
+ >Foo<br
+ />Bar<br
+ />Baz</td
+ ></tr
+ ><tr
+ ><th
+ >Safe Haskell</th
+ ><td
+ >Safe</td
+ ></tr
+ ></table
+ ><p class="caption"
+ >Bug280</p
+ ></div
+ ><div id="description"
+ ><p class="caption"
+ >Description</p
+ ><div class="doc"
+ ><p
+ >The module description</p
+ ></div
+ ></div
+ ><div id="interface"
+ ><h1
+ >Documentation</h1
+ ><div class="top"
+ ><p class="src"
+ ><a id="v:x" class="def"
+ >x</a
+ > :: [<a href="#"
+ >Char</a
+ >] <a href="#" class="selflink"
+ >#</a
+ ></p
+ ></div
+ ></div
+ ></div
+ ><div id="footer"
+ ></div
+ ></body
+ ></html
+>
diff --git a/html-test/ref/Test.html b/html-test/ref/Test.html
index e493af28..a98b2228 100644
--- a/html-test/ref/Test.html
+++ b/html-test/ref/Test.html
@@ -33,7 +33,7 @@ window.onload = function () {pageLoad();setSynopsis(&quot;mini_Test.html&quot;);
><div id="module-header"
><table class="info"
><tr
- ><th
+ ><th valign="top"
>Copyright</th
><td
>(c) Simon Marlow 2002</td
diff --git a/html-test/ref/frames.html b/html-test/ref/frames.html
deleted file mode 100644
index e86edb66..00000000
--- a/html-test/ref/frames.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title></title>
-<script src="haddock-util.js" type="text/javascript"></script>
-<script type="text/javascript"><!--
-/*
-
- The synopsis frame needs to be updated using javascript, so we hide
- it by default and only show it if javascript is enabled.
-
- TODO: provide some means to disable it.
-*/
-function load() {
- var d = document.getElementById("inner-fs");
- d.rows = "50%,50%";
- postReframe();
-}
---></script>
-</head>
-<frameset id="outer-fs" cols="25%,75%" onload="load()">
- <frameset id="inner-fs" rows="100%,0%">
- <frame src="index-frames.html" name="modules" />
- <frame src="" name="synopsis" />
- </frameset>
- <frame src="index.html" name="main" />
-</frameset>
-</html>
diff --git a/html-test/ref/haddock-util.js b/html-test/ref/haddock-util.js
index fc7743fe..92d07d2a 100644
--- a/html-test/ref/haddock-util.js
+++ b/html-test/ref/haddock-util.js
@@ -248,33 +248,6 @@ function addMenuItem(html) {
}
}
-function adjustForFrames() {
- var bodyCls;
-
- if (parent.location.href == window.location.href) {
- // not in frames, so add Frames button
- addMenuItem("<a href='#' onclick='reframe();return true;'>Frames</a>");
- bodyCls = "no-frame";
- }
- else {
- bodyCls = "in-frame";
- }
- addClass(document.body, bodyCls);
-}
-
-function reframe() {
- setCookie("haddock-reframe", document.URL);
- window.location = "frames.html";
-}
-
-function postReframe() {
- var s = getCookie("haddock-reframe");
- if (s) {
- parent.window.main.location = s;
- clearCookie("haddock-reframe");
- }
-}
-
function styles() {
var i, a, es = document.getElementsByTagName("link"), rs = [];
for (i = 0; a = es[i]; i++) {
@@ -337,7 +310,6 @@ function styleMenu(show) {
function pageLoad() {
addStyleMenu();
- adjustForFrames();
resetStyle();
restoreCollapsed();
}
diff --git a/html-test/src/Bug280.hs b/html-test/src/Bug280.hs
new file mode 100644
index 00000000..ac27e2e5
--- /dev/null
+++ b/html-test/src/Bug280.hs
@@ -0,0 +1,11 @@
+{-|
+Copyright: Foo,
+ Bar,
+ Baz
+
+The module description
+-}
+-- The module header can start with newlines. They are not taken into account for the indentation level
+module Bug280 where
+
+x = ""