aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-11-07 10:22:31 -0800
committerAlec Theriault <alec.theriault@gmail.com>2018-11-07 12:37:18 -0800
commit2a46036ea4e2e6bb6505ebbfd3e4609aeb7c3845 (patch)
treebf069d7d4f2072c100cf5166ffa9f357d0636b3f
parent74f791936f28b175265994494412698e90d0e85f (diff)
Fix issues around plus/minus
* swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page
-rw-r--r--ghc.mk3
-rw-r--r--haddock-api/haddock-api.cabal3
-rw-r--r--haddock-api/resources/html/NewOcean.std-theme/minus.gifbin56 -> 0 bytes
-rw-r--r--haddock-api/resources/html/NewOcean.std-theme/new-ocean.css14
-rw-r--r--haddock-api/resources/html/NewOcean.std-theme/plus.gifbin59 -> 0 bytes
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml.hs1
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Layout.hs7
7 files changed, 11 insertions, 17 deletions
diff --git a/ghc.mk b/ghc.mk
index a10fd61a..d3b02b6e 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -45,10 +45,7 @@ utils/haddock_dist_DATA_FILES += html/Ocean.theme/minus.gif
utils/haddock_dist_DATA_FILES += html/Ocean.theme/ocean.css
utils/haddock_dist_DATA_FILES += html/Ocean.theme/plus.gif
utils/haddock_dist_DATA_FILES += html/Ocean.theme/synopsis.png
-utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/hslogo-16.png
-utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/minus.gif
utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/new-ocean.css
-utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/plus.gif
utils/haddock_dist_DATA_FILES += html/NewOcean.std-theme/synopsis.png
utils/haddock_dist_DATA_FILES += html/solarized.css
utils/haddock_dist_DATA_FILES += html/highlight.js
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index d5c976b6..a410f436 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -34,10 +34,7 @@ data-files:
html/Ocean.theme/ocean.css
html/Ocean.theme/plus.gif
html/Ocean.theme/synopsis.png
- html/NewOcean.std-theme/hslogo-16.png
- html/NewOcean.std-theme/minus.gif
html/NewOcean.std-theme/new-ocean.css
- html/NewOcean.std-theme/plus.gif
html/NewOcean.std-theme/synopsis.png
latex/haddock.sty
diff --git a/haddock-api/resources/html/NewOcean.std-theme/minus.gif b/haddock-api/resources/html/NewOcean.std-theme/minus.gif
deleted file mode 100644
index 1deac2fe..00000000
--- a/haddock-api/resources/html/NewOcean.std-theme/minus.gif
+++ /dev/null
Binary files differ
diff --git a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css
index 8416176c..7568032f 100644
--- a/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css
+++ b/haddock-api/resources/html/NewOcean.std-theme/new-ocean.css
@@ -352,7 +352,7 @@ ul.links li a {
.show { display: inherit; }
.clear { clear: both; }
-.collapser:before, .expander:before {
+.collapser:before, .expander:before, .noexpander:before {
font-size: 1.2em;
color: #9C5791;
display: inline-block;
@@ -360,11 +360,15 @@ ul.links li a {
}
.collapser:before {
- content: '⊗';
+ content: '⊖';
}
.expander:before {
content: "⊕";
}
+.noexpander:before {
+ content: "⊕";
+ visibility: hidden;
+}
.collapser, .expander {
cursor: pointer;
@@ -380,12 +384,6 @@ ul.links li a {
summary {
cursor: pointer;
outline: none;
- list-style-image: url(plus.gif);
- list-style-position: outside;
-}
-
-details[open] > summary {
- list-style-image: url(minus.gif);
}
pre {
diff --git a/haddock-api/resources/html/NewOcean.std-theme/plus.gif b/haddock-api/resources/html/NewOcean.std-theme/plus.gif
deleted file mode 100644
index 2d15c141..00000000
--- a/haddock-api/resources/html/NewOcean.std-theme/plus.gif
+++ /dev/null
Binary files differ
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 2b8bdd69..2206b7dc 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -324,6 +324,7 @@ mkNode pkg qual ss p (Node s leaf _pkg srcPkg short ts) =
cBtn = case (ts, leaf) of
(_:_, Just _) -> thespan ! collapseControl p "" << spaceHtml
+ ([] , Just _) -> thespan ! [theclass "noexpander"] << spaceHtml
(_, _ ) -> noHtml
-- We only need an explicit collapser button when the module name
-- is also a leaf, and so is a link to a module page. Indeed, the
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index 10a6d499..c935bc5f 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -195,17 +195,18 @@ subEquations :: Maybe Package -> Qualification -> [SubDecl] -> Html
subEquations pkg qual = divSubDecls "equations" "Equations" . subTable pkg qual
--- | Generate sub table for instance declarations, with source
+-- | Generate collapsible sub table for instance declarations, with source
subInstances :: Maybe Package -> Qualification
-> String -- ^ Class name, used for anchor generation
-> LinksInfo -> Bool
-> [(SubDecl, Maybe Module, Located DocName)] -> Html
subInstances pkg qual nm lnks splice = maybe noHtml wrap . instTable
where
- wrap contents = subSection (collapseDetails id_ DetailsOpen (summary +++ contents))
+ wrap contents = subSection (hdr +++ collapseDetails id_ DetailsOpen (summary +++ contents))
instTable = subTableSrc pkg qual lnks splice
subSection = thediv ! [theclass "subs instances"]
- summary = thesummary << "Instances"
+ hdr = h4 ! collapseControl id_ "instances" << "Instances"
+ summary = thesummary ! [ theclass "hide-when-js-enabled" ] << "Instances details"
id_ = makeAnchorId $ "i:" ++ nm