aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-04-25 05:23:28 +0000
committerMark Lentczner <markl@glyphic.com>2010-04-25 05:23:28 +0000
commitc428aace2d2332b57acd05bc3d1b5631300eda9e (patch)
treed1a92545d3908580070d28505f40506d4b35a4a1 /src/Haddock
parent40c87f79ff5e34efb4bffa306f328a5ad28a232e (diff)
fixed surround of instance and constructor tables
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/Backends/Xhtml/Decl.hs42
-rw-r--r--src/Haddock/Backends/Xhtml/Layout.hs12
2 files changed, 23 insertions, 31 deletions
diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs
index 34d509f8..b83053a5 100644
--- a/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/src/Haddock/Backends/Xhtml/Decl.hs
@@ -175,13 +175,11 @@ ppTyFam summary associated links loc mbDoc decl unicode
instancesBit
| associated || null instances = noHtml
- | otherwise = vanillaTable << (
- instHdr instId </>
- tda [theclass "body"] <<
- collapsed thediv instId (
- spacedTable1 << (
- aboves (map (ppDocInstance unicode) instances)
- )
+ | otherwise =
+ instHdr instId +++
+ collapsed thediv instId (
+ spacedTable1 << (
+ aboves (map (ppDocInstance unicode) instances)
)
)
@@ -387,13 +385,12 @@ ppClassDecl summary links instances loc mbDoc subdocs
instId = collapseId (getName nm)
instancesBit
| null instances = noHtml
- | otherwise = vanillaTable << (
- instHdr instId </>
- tda [theclass "body"] <<
- collapsed thediv instId (
- spacedTable1 << aboves (map (ppDocInstance unicode) instances)
- )
- )
+ | otherwise =
+ instHdr instId +++
+ collapsed thediv instId (
+ spacedTable1 << aboves (map (ppDocInstance unicode) instances)
+ )
+
ppClassDecl _ _ _ _ _ _ _ _ = error "declaration type not supported by ppShortClassDecl"
@@ -451,7 +448,7 @@ ppDataDecl :: Bool -> LinksInfo -> [DocInstance DocName] ->
ppDataDecl summary links instances subdocs loc mbDoc dataDecl unicode
| summary = ppShortDataDecl summary links loc dataDecl unicode
- | otherwise = header_ +++ datadoc +++ constrBit +++ instancesBit
+ | otherwise = header_ +++ maybeDocToHtml mbDoc +++ constrBit +++ instancesBit
where
docname = unLoc . tcdLName $ dataDecl
@@ -471,24 +468,19 @@ ppDataDecl summary links instances subdocs loc mbDoc dataDecl unicode
| any isRecCon cons = spacedTable5
| otherwise = spacedTable1
- datadoc = case mbDoc of
- Just doc -> ndocBox (docToHtml doc)
- Nothing -> emptyTable
-
constrBit
- | null cons = emptyTable
- | otherwise = constrHdr </> (
- tda [theclass "body"] << constrTable <<
+ | null cons = noHtml
+ | otherwise = constrHdr +++ (
+ constrTable <<
aboves (map (ppSideBySideConstr subdocs unicode) cons)
)
instId = collapseId (getName docname)
instancesBit
- | null instances = emptyTable
+ | null instances = noHtml
| otherwise
- = instHdr instId </>
- tda [theclass "body"] <<
+ = instHdr instId +++
collapsed thediv instId (
spacedTable1 << aboves (map (ppDocInstance unicode) instances
)
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs
index 124d6150..8f9e83e5 100644
--- a/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/src/Haddock/Backends/Xhtml/Layout.hs
@@ -92,11 +92,11 @@ spacedTable1, spacedTable5 :: Html -> Html
spacedTable1 = table ! [theclass "vanilla", cellspacing 1, cellpadding 0]
spacedTable5 = table ! [theclass "vanilla", cellspacing 5, cellpadding 0]
-constrHdr, methHdr, atHdr :: HtmlTable
-constrHdr = tda [ theclass "section4" ] << toHtml "Constructors"
-methHdr = tda [ theclass "section4" ] << toHtml "Methods"
-atHdr = tda [ theclass "section4" ] << toHtml "Associated Types"
+constrHdr, methHdr, atHdr :: Html
+constrHdr = h5 << "Constructors"
+methHdr = h5 << "Methods"
+atHdr = h5 << "Associated Types"
-instHdr :: String -> HtmlTable
+instHdr :: String -> Html
instHdr id_ =
- tda [ theclass "section4" ] << (collapsebutton id_ +++ toHtml " Instances")
+ h5 << (collapsebutton id_ +++ toHtml " Instances")