diff options
author | Ian Lynagh <igloo@earth.li> | 2012-07-19 20:38:26 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-07-19 20:38:26 +0100 |
commit | 7f164839d8b0b6e53fa0f15d2a6810ca310e337d (patch) | |
tree | 34a2bdeb25673b73d3a6935ab5d4170f94bc11a0 /src/Haddock/Backends/Xhtml/Layout.hs | |
parent | 4dc9ecd3905f75adb6bcfb818fbc163c724d4545 (diff) | |
parent | 6e8bc1dca77bbbc5743f63a2e8ea5b1eab0ed80c (diff) |
Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index bdd5ac78..3ddbd28b 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 |