aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2012-02-04 03:01:30 +0100
committerDavid Waern <david.waern@gmail.com>2012-02-04 03:01:30 +0100
commit5e0812943b3da5952e9c50fb93f6079cb9f1c858 (patch)
tree20452e6b4a370f419fb55bb3795e7f81125a1bb6 /src/Haddock/Backends/Xhtml
parente596b668926725fc19f1e4f63ffcc569cdd93eda (diff)
parent11385cf01f0d852782444ebfeb4e5092c174c6f8 (diff)
Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4
Diffstat (limited to 'src/Haddock/Backends/Xhtml')
-rw-r--r--src/Haddock/Backends/Xhtml/Layout.hs9
-rw-r--r--src/Haddock/Backends/Xhtml/Utils.hs11
2 files changed, 10 insertions, 10 deletions
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 +++ '`'