aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Layout.hs18
1 files changed, 13 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index 98df09fe..367eec4d 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -31,7 +31,8 @@ module Haddock.Backends.Xhtml.Layout (
subConstructors,
subEquations,
subFields,
- subInstances, subOrphanInstances, subInstHead, subInstDetails,
+ subInstances, subOrphanInstances,
+ subInstHead, subInstDetails, subFamInstDetails,
subMethods,
subMinimal,
@@ -178,7 +179,6 @@ subAssociatedTypes = divSubDecls "associated-types" "Associated Types" . subBloc
subConstructors :: Qualification -> [SubDecl] -> Html
subConstructors qual = divSubDecls "constructors" "Constructors" . subTable qual
-
subFields :: Qualification -> [SubDecl] -> Html
subFields qual = divSubDecls "fields" "Fields" . subDlist qual
@@ -225,10 +225,18 @@ subInstDetails :: String -- ^ Instance unique id (for anchor generation)
-> [Html] -- ^ Method contents (pretty-printed signatures)
-> Html
subInstDetails iid ats mets =
- section << (subAssociatedTypes ats <+> subMethods mets)
- where
- section = thediv ! collapseSection (instAnchorId iid) False "inst-details"
+ subInstSection iid << (subAssociatedTypes ats <+> subMethods mets)
+
+subFamInstDetails :: String -- ^ Instance unique id (for anchor generation)
+ -> Html -- ^ Type or data family instance
+ -> Html
+subFamInstDetails iid fi =
+ subInstSection iid << declElem fi
+subInstSection :: String -- ^ Instance unique id (for anchor generation)
+ -> Html
+ -> Html
+subInstSection iid = thediv ! collapseSection (instAnchorId iid) False "inst-details"
instAnchorId :: String -> String
instAnchorId iid = makeAnchorId $ "i:" ++ iid