diff options
author | David Waern <david.waern@gmail.com> | 2012-02-04 03:01:30 +0100 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2012-02-04 03:01:30 +0100 |
commit | 5e0812943b3da5952e9c50fb93f6079cb9f1c858 (patch) | |
tree | 20452e6b4a370f419fb55bb3795e7f81125a1bb6 | |
parent | e596b668926725fc19f1e4f63ffcc569cdd93eda (diff) | |
parent | 11385cf01f0d852782444ebfeb4e5092c174c6f8 (diff) |
Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4
34 files changed, 46 insertions, 44 deletions
diff --git a/html/frames.html b/html/frames.html index 30ce1fa5..1b4e38d4 100644 --- a/html/frames.html +++ b/html/frames.html @@ -3,6 +3,7 @@ "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"><!-- /* @@ -18,11 +19,12 @@ function load() { 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"> + <frame src="index-frames.html" name="modules" /> + <frame src="" name="synopsis" /> </frameset> - <frame src="index.html" name="main"> + <frame src="index.html" name="main" /> </frameset> </html> diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 52bde5b6..c8998f3e 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -175,7 +175,7 @@ bodyHtml doctitle iface contentsButton maybe_contents_url, indexButton maybe_index_url]) ! [theclass "links", identifier "page-menu"], - nonEmpty sectionName << doctitle + nonEmptySectionName << doctitle ], divContent << pageContent, divFooter << paragraph << ( diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index bdd5ac78..da17552c 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -18,6 +18,7 @@ module Haddock.Backends.Xhtml.Layout ( divIndex, divAlphabet, divModuleList, sectionName, + nonEmptySectionName, shortDeclList, shortSubDecls, @@ -66,6 +67,14 @@ sectionName :: Html -> Html sectionName = paragraph ! [theclass "caption"] +-- | Make an element that always has at least something (a non-breaking space) +-- If it would have otherwise been empty, then give it the class ".empty" +nonEmptySectionName :: Html -> Html +nonEmptySectionName c + | isNoHtml c = paragraph ! [theclass "caption empty"] $ spaceHtml + | otherwise = paragraph ! [theclass "caption"] $ c + + divPackageHeader, divContent, divModuleHeader, divFooter, divTableOfContents, divDescription, divSynposis, divInterface, divIndex, divAlphabet, divModuleList diff --git a/src/Haddock/Backends/Xhtml/Utils.hs b/src/Haddock/Backends/Xhtml/Utils.hs index 7ba6d5f4..c020c64d 100644 --- a/src/Haddock/Backends/Xhtml/Utils.hs +++ b/src/Haddock/Backends/Xhtml/Utils.hs @@ -17,7 +17,7 @@ module Haddock.Backends.Xhtml.Utils ( spliceURL, groupId, - (<+>), char, nonEmpty, + (<+>), char, keyword, punctuate, braces, brackets, pabrackets, parens, parenList, ubxParenList, @@ -119,15 +119,6 @@ char :: Char -> Html char c = toHtml [c] --- | Make an element that always has at least something (a non-breaking space) --- If it would have otherwise been empty, then give it the class ".empty" -nonEmpty :: (Html -> Html) -> Html -> Html -nonEmpty el content_ = - if isNoHtml content_ - then el ! [theclass "empty"] << spaceHtml - else el << content_ - - quote :: Html -> Html quote h = char '`' +++ h +++ '`' diff --git a/tests/html-tests/tests/A.html.ref b/tests/html-tests/tests/A.html.ref index 143f8a73..152dabf7 100644 --- a/tests/html-tests/tests/A.html.ref +++ b/tests/html-tests/tests/A.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_A.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/B.html.ref b/tests/html-tests/tests/B.html.ref index 374e34e3..ed81cd2a 100644 --- a/tests/html-tests/tests/B.html.ref +++ b/tests/html-tests/tests/B.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_B.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug1.html.ref b/tests/html-tests/tests/Bug1.html.ref index f565996b..542fc770 100644 --- a/tests/html-tests/tests/Bug1.html.ref +++ b/tests/html-tests/tests/Bug1.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug1.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug2.html.ref b/tests/html-tests/tests/Bug2.html.ref index e28d2dea..1e410bb3 100644 --- a/tests/html-tests/tests/Bug2.html.ref +++ b/tests/html-tests/tests/Bug2.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug2.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug3.html.ref b/tests/html-tests/tests/Bug3.html.ref index 66317897..a9489013 100644 --- a/tests/html-tests/tests/Bug3.html.ref +++ b/tests/html-tests/tests/Bug3.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug3.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug4.html.ref b/tests/html-tests/tests/Bug4.html.ref index b19a428e..7698386d 100644 --- a/tests/html-tests/tests/Bug4.html.ref +++ b/tests/html-tests/tests/Bug4.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug4.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug6.html.ref b/tests/html-tests/tests/Bug6.html.ref index c05c1f94..35246a22 100644 --- a/tests/html-tests/tests/Bug6.html.ref +++ b/tests/html-tests/tests/Bug6.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug6.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug7.html.ref b/tests/html-tests/tests/Bug7.html.ref index f7ab171a..75a37c2c 100644 --- a/tests/html-tests/tests/Bug7.html.ref +++ b/tests/html-tests/tests/Bug7.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bug8.html.ref b/tests/html-tests/tests/Bug8.html.ref index 05d3ebeb..ff6dcf79 100644 --- a/tests/html-tests/tests/Bug8.html.ref +++ b/tests/html-tests/tests/Bug8.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug8.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Bugs.html.ref b/tests/html-tests/tests/Bugs.html.ref index 61d3a82b..920c9cae 100644 --- a/tests/html-tests/tests/Bugs.html.ref +++ b/tests/html-tests/tests/Bugs.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bugs.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/CrossPackageDocs.html.ref b/tests/html-tests/tests/CrossPackageDocs.html.ref index c12f697d..94948b2a 100644 --- a/tests/html-tests/tests/CrossPackageDocs.html.ref +++ b/tests/html-tests/tests/CrossPackageDocs.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_CrossPackageDocs.html" >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Examples.html.ref b/tests/html-tests/tests/Examples.html.ref index 4a44907c..a96ee5ff 100644 --- a/tests/html-tests/tests/Examples.html.ref +++ b/tests/html-tests/tests/Examples.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Examples.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/FunArgs.html.ref b/tests/html-tests/tests/FunArgs.html.ref index 15be13a7..011c7fca 100644 --- a/tests/html-tests/tests/FunArgs.html.ref +++ b/tests/html-tests/tests/FunArgs.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_FunArgs.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/GADTRecords.html.ref b/tests/html-tests/tests/GADTRecords.html.ref index 349a9d10..317d0f9b 100644 --- a/tests/html-tests/tests/GADTRecords.html.ref +++ b/tests/html-tests/tests/GADTRecords.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_GADTRecords.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Hash.html.ref b/tests/html-tests/tests/Hash.html.ref index b6ee0c26..e0dda2ef 100644 --- a/tests/html-tests/tests/Hash.html.ref +++ b/tests/html-tests/tests/Hash.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/NamedDoc.html.ref b/tests/html-tests/tests/NamedDoc.html.ref index 40c4ebeb..e5b34bb3 100644 --- a/tests/html-tests/tests/NamedDoc.html.ref +++ b/tests/html-tests/tests/NamedDoc.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NamedDoc.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/NoLayout.html.ref b/tests/html-tests/tests/NoLayout.html.ref index cdf0e799..f6499684 100644 --- a/tests/html-tests/tests/NoLayout.html.ref +++ b/tests/html-tests/tests/NoLayout.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NoLayout.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/NonGreedy.html.ref b/tests/html-tests/tests/NonGreedy.html.ref index c707a6bc..cf9ca1b3 100644 --- a/tests/html-tests/tests/NonGreedy.html.ref +++ b/tests/html-tests/tests/NonGreedy.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_NonGreedy.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/QuasiExpr.html.ref b/tests/html-tests/tests/QuasiExpr.html.ref index 8241c3f7..b071db72 100644 --- a/tests/html-tests/tests/QuasiExpr.html.ref +++ b/tests/html-tests/tests/QuasiExpr.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_QuasiExpr.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/QuasiQuote.html.ref b/tests/html-tests/tests/QuasiQuote.html.ref index 2613b657..0ef8dce9 100644 --- a/tests/html-tests/tests/QuasiQuote.html.ref +++ b/tests/html-tests/tests/QuasiQuote.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_QuasiQuote.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/TH.html.ref b/tests/html-tests/tests/TH.html.ref index 2deb950d..9989db89 100644 --- a/tests/html-tests/tests/TH.html.ref +++ b/tests/html-tests/tests/TH.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TH.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/TH2.html.ref b/tests/html-tests/tests/TH2.html.ref index 3d284850..d264c951 100644 --- a/tests/html-tests/tests/TH2.html.ref +++ b/tests/html-tests/tests/TH2.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TH2.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Test.html.ref b/tests/html-tests/tests/Test.html.ref index 84d28b10..6da73275 100644 --- a/tests/html-tests/tests/Test.html.ref +++ b/tests/html-tests/tests/Test.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Test.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Ticket112.html.ref b/tests/html-tests/tests/Ticket112.html.ref index b21f628c..0a96d171 100644 --- a/tests/html-tests/tests/Ticket112.html.ref +++ b/tests/html-tests/tests/Ticket112.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket112.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Ticket61.html.ref b/tests/html-tests/tests/Ticket61.html.ref index 111c2cc3..f2b04a7b 100644 --- a/tests/html-tests/tests/Ticket61.html.ref +++ b/tests/html-tests/tests/Ticket61.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket61.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Ticket75.html.ref b/tests/html-tests/tests/Ticket75.html.ref index e9fef85a..f65f6b10 100644 --- a/tests/html-tests/tests/Ticket75.html.ref +++ b/tests/html-tests/tests/Ticket75.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Ticket75.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/TypeFamilies.html.ref b/tests/html-tests/tests/TypeFamilies.html.ref index a3d94bb0..84246930 100644 --- a/tests/html-tests/tests/TypeFamilies.html.ref +++ b/tests/html-tests/tests/TypeFamilies.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeFamilies.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/TypeOperators.html.ref b/tests/html-tests/tests/TypeOperators.html.ref index 59f47a55..b11f8bf0 100644 --- a/tests/html-tests/tests/TypeOperators.html.ref +++ b/tests/html-tests/tests/TypeOperators.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");} >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Unicode.html.ref b/tests/html-tests/tests/Unicode.html.ref index d234d374..e25b6cf6 100644 --- a/tests/html-tests/tests/Unicode.html.ref +++ b/tests/html-tests/tests/Unicode.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Unicode.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" diff --git a/tests/html-tests/tests/Visible.html.ref b/tests/html-tests/tests/Visible.html.ref index a2c52407..29f321d7 100644 --- a/tests/html-tests/tests/Visible.html.ref +++ b/tests/html-tests/tests/Visible.html.ref @@ -25,7 +25,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Visible.html");}; >Index</a ></li ></ul - ><p class="caption" class="empty" + ><p class="caption empty" > </p ></div ><div id="content" |