From 10437c8cfe3524eee7e1cc297cd6ae7dff16dbb3 Mon Sep 17 00:00:00 2001
From: Mateusz Kowalczyk
Date: Thu, 26 Mar 2015 16:31:40 +0000
Subject: Remove now redundant imports
---
haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 2 --
1 file changed, 2 deletions(-)
(limited to 'haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs')
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index 96d734eb..e807eb94 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -19,8 +19,6 @@ module Haddock.Backends.Xhtml.DocMarkup (
docElement, docSection, docSection_,
) where
-import Control.Applicative ((<$>))
-
import Data.List
import Haddock.Backends.Xhtml.Names
import Haddock.Backends.Xhtml.Utils
--
cgit v1.2.3
From 5d04e313cc52ecf88b0fd0b3d0d39ce6a8dc7406 Mon Sep 17 00:00:00 2001
From: watashi
Date: Sun, 26 Apr 2015 16:35:28 -0700
Subject: Do not insert anchor for section headings in contents box
---
.gitignore | 3 +
.../src/Haddock/Backends/Xhtml/DocMarkup.hs | 5 +-
html-test/ref/Bug387.html | 111 +++++++++++++++++++++
html-test/src/Bug387.hs | 12 +++
4 files changed, 130 insertions(+), 1 deletion(-)
create mode 100644 html-test/ref/Bug387.html
create mode 100644 html-test/src/Bug387.hs
(limited to 'haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs')
diff --git a/.gitignore b/.gitignore
index 6b8d26e0..2d3f4516 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,6 @@
/doc/configure
tags
TAGS
+
+.cabal-sandbox
+cabal.sandbox.config
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index e807eb94..c23f3f08 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -62,7 +62,10 @@ parHtmlMarkup qual insertAnchors ppId = Markup {
then anchor ! [href url]
<< fromMaybe url mLabel
else toHtml $ fromMaybe url mLabel,
- markupAName = \aname -> namedAnchor aname << "",
+ markupAName = \aname
+ -> if insertAnchors
+ then namedAnchor aname << ""
+ else noHtml,
markupPic = \(Picture uri t) -> image ! ([src uri] ++ fromMaybe [] (return . title <$> t)),
markupProperty = pre . toHtml,
markupExample = examplesToHtml,
diff --git a/html-test/ref/Bug387.html b/html-test/ref/Bug387.html
new file mode 100644
index 00000000..2d2009b1
--- /dev/null
+++ b/html-test/ref/Bug387.html
@@ -0,0 +1,111 @@
+
+Bug387
diff --git a/html-test/src/Bug387.hs b/html-test/src/Bug387.hs
new file mode 100644
index 00000000..d9fed34e
--- /dev/null
+++ b/html-test/src/Bug387.hs
@@ -0,0 +1,12 @@
+module Bug387
+ ( -- * Section1#a:section1#
+ test1
+ -- * Section2#a:section2#
+ , test2
+ ) where
+
+test1 :: Int
+test1 = 223
+
+test2 :: Int
+test2 = 42
--
cgit v1.2.3
From 06e0766810779180dbc52d15c0df5a2eaaf1881e Mon Sep 17 00:00:00 2001
From: Mateusz Kowalczyk
Date: Sat, 11 Jul 2015 14:23:05 +0100
Subject: Fix expansion icon for user-collapsible sections
Closes #412
---
CHANGES | 2 ++
haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 5 +++--
html-test/ref/Bug335.html | 6 +++---
3 files changed, 8 insertions(+), 5 deletions(-)
(limited to 'haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs')
diff --git a/CHANGES b/CHANGES
index ff49b6f5..be829adf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,8 @@ Changes in version 2.16.1
* Generate hyperlinked source ourselves (#410, part of GSOC 2015)
+ * Fix expansion icon for user-collapsible sections (#412)
+
Changes in version 2.16.0
* Experimental collapsible header support (#335)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index c23f3f08..3fe74a82 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -161,8 +161,9 @@ hackMarkup fmt' h' =
UntouchedDoc d -> (markup fmt $ _doc d, [_meta d])
CollapsingHeader (Header lvl titl) par n nm ->
let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n
- col' = collapseControl id_ True "caption"
- instTable = (thediv ! collapseSection id_ False [] <<)
+ expanded = False
+ col' = collapseControl id_ expanded "caption"
+ instTable = (thediv ! collapseSection id_ expanded [] <<)
lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6]
getHeader = fromMaybe caption (lookup lvl lvs)
subCaption = getHeader ! col' << markup fmt titl
diff --git a/html-test/ref/Bug335.html b/html-test/ref/Bug335.html
index 6f3d3820..dbe97422 100644
--- a/html-test/ref/Bug335.html
+++ b/html-test/ref/Bug335.html
@@ -64,7 +64,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug335.html");};
>f :: ()
ExF:
g :: ()
ExG:
Produced by Haddock version 2.16.0
version 2.16.1