diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-05-04 06:14:34 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-05-04 06:14:34 +0000 |
commit | baa8453620fc1a69cecf6c888410242d6c5cce10 (patch) | |
tree | 6eb45f1a29d772570da7ecb666cc69dd60761ba6 | |
parent | 734a15953ecf139274ac1f95d7e36fd5477f7b98 (diff) |
added assoicated types and methods back into class decls
-rw-r--r-- | html/xhaddock.css | 2 | ||||
-rw-r--r-- | src/Haddock/Backends/Xhtml/Decl.hs | 25 |
2 files changed, 23 insertions, 4 deletions
diff --git a/html/xhaddock.css b/html/xhaddock.css index 8f4d71e1..6eb060fb 100644 --- a/html/xhaddock.css +++ b/html/xhaddock.css @@ -183,7 +183,7 @@ div.decldoc h5 { margin-left: 10px; } -div.decldoc table { +div.decldoc table, div.subdecl { margin-left: 20px; } diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 210a69f8..a40605b4 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -367,9 +367,10 @@ ppClassDecl :: Bool -> LinksInfo -> [DocInstance DocName] -> SrcSpan -> Maybe (Doc DocName) -> [(DocName, DocForDecl DocName)] -> TyClDecl DocName -> Bool -> Html ppClassDecl summary links instances loc mbDoc subdocs - decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ _ _) unicode + decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ ats _) unicode | summary = ppShortClassDecl summary links decl loc subdocs unicode - | otherwise = classheader +++ maybeDocToHtml mbDoc +++ instancesBit + | otherwise = classheader +++ maybeDocToHtml mbDoc + +++ atBit +++ methodBit +++ instancesBit where classheader | null lsigs = topDeclElem links loc nm (hdr unicode) @@ -378,7 +379,25 @@ ppClassDecl summary links instances loc mbDoc subdocs nm = unLoc $ tcdLName decl hdr = ppClassHdr summary lctxt (unLoc lname) ltyvars lfds - + + atBit + | null ats = noHtml + | otherwise = atHdr +++ ( + thediv ! [theclass "subdecl"] << + concatHtml [ ppAssocType summary links doc at unicode + | at <- ats + , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ] + ) + + methodBit + | null lsigs = noHtml + | otherwise = methHdr +++ ( + thediv ! [theclass "subdecl"] << + concatHtml [ ppFunSig summary links loc doc n typ unicode + | L _ (TypeSig (L _ n) (L _ typ)) <- lsigs + , let doc = lookupAnySubdoc n subdocs ] + ) + instId = collapseId (getName nm) instancesBit | null instances = noHtml |