diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-14 16:28:53 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-14 16:28:53 +0000 |
commit | 71cd0a0b39816bcae656857688a5b1e63b429532 (patch) | |
tree | 9f91e84a7abafd35b3cb19f1346e49a79e7a9848 /src/Haddock/Backends/Xhtml/Layout.hs | |
parent | 21d6bb713fac1fbbc988a9939d7b0b1edc7a5f64 (diff) |
convert instances to SubDecl
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index 440d8e1e..70f5d88c 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -21,11 +21,13 @@ module Haddock.Backends.Xhtml.Layout ( SubDecl, subArguments, - subConstructors, subFields, + subConstructors, + subFields, + subInstances, topDeclElem, declElem, - instHdr, atHdr, methHdr, + atHdr, methHdr, argBox, ndocBox, rdocBox, maybeRDocBox, vanillaTable, vanillaTable2, spacedTable1, spacedTable5 @@ -70,7 +72,7 @@ divTopDecl = thediv ! [theclass "top"] type SubDecl = (Html, Maybe (Doc DocName), [Html]) -divSubDecls :: String -> String -> Maybe Html -> Html +divSubDecls :: (HTML a) => String -> a -> Maybe Html -> Html divSubDecls cssClass captionName = maybe noHtml wrap where wrap = (subSection <<) . (subCaption +++) @@ -109,6 +111,11 @@ subConstructors = divSubDecls "constructors" "Constructors" . subTable subFields :: [(Html, Maybe (Doc DocName), [Html])] -> Html subFields = divSubDecls "fields" "Fields" . subTable +subInstances :: String -> [(Html, Maybe (Doc DocName), [Html])] -> Html +subInstances id_ = divSubDecls "instances" instCaption . instTable + where + instCaption = collapsebutton id_ +++ " Instances" + instTable = (collapsed thediv id_ `fmap`) . subTable -- a box for displaying code declElem :: Html -> Html @@ -178,7 +185,3 @@ spacedTable5 = table ! [theclass "vanilla", cellspacing 5, cellpadding 0] methHdr, atHdr :: Html methHdr = h5 << "Methods" atHdr = h5 << "Associated Types" - -instHdr :: String -> Html -instHdr id_ = - h5 << (collapsebutton id_ +++ toHtml " Instances") |