From 2b87648737ad5b07e30d9bb03f7c4e3953566c24 Mon Sep 17 00:00:00 2001 From: Tobias Brandt Date: Fri, 27 Aug 2010 07:01:21 +0000 Subject: adding the option to fully qualify identifiers --- src/Haddock/Backends/Xhtml/Layout.hs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/Haddock/Backends/Xhtml/Layout.hs') diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index 295af305..7277a683 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -112,25 +112,25 @@ divSubDecls cssClass captionName = maybe noHtml wrap subCaption = paragraph ! [theclass "caption"] << captionName -subDlist :: [SubDecl] -> Maybe Html -subDlist [] = Nothing -subDlist decls = Just $ dlist << map subEntry decls +++ clearDiv +subDlist :: Qualification -> [SubDecl] -> Maybe Html +subDlist _ [] = Nothing +subDlist quali decls = Just $ dlist << map subEntry decls +++ clearDiv where subEntry (decl, mdoc, subs) = dterm ! [theclass "src"] << decl +++ - docElement ddef << (fmap docToHtml mdoc +++ subs) + docElement ddef << (fmap docToHtml mdoc +++ subs) clearDiv = thediv ! [ theclass "clear" ] << noHtml -subTable :: [SubDecl] -> Maybe Html -subTable [] = Nothing -subTable decls = Just $ table << aboves (concatMap subRow decls) +subTable :: Qualification -> [SubDecl] -> Maybe Html +subTable _ [] = Nothing +subTable quali decls = Just $ table << aboves (concatMap subRow decls) where subRow (decl, mdoc, subs) = (td ! [theclass "src"] << decl <-> - docElement td << fmap docToHtml mdoc) + docElement td << fmap (docToHtml quali) mdoc) : map (cell . (td <<)) subs @@ -139,27 +139,27 @@ subBlock [] = Nothing subBlock hs = Just $ toHtml hs -subArguments :: [SubDecl] -> Html -subArguments = divSubDecls "arguments" "Arguments" . subTable +subArguments :: Qualification -> [SubDecl] -> Html +subArguments quali = divSubDecls "arguments" "Arguments" . (subTable quali) subAssociatedTypes :: [Html] -> Html subAssociatedTypes = divSubDecls "associated-types" "Associated Types" . subBlock -subConstructors :: [SubDecl] -> Html -subConstructors = divSubDecls "constructors" "Constructors" . subTable +subConstructors :: Qualification -> [SubDecl] -> Html +subConstructors quali = divSubDecls "constructors" "Constructors" . (subTable quali) -subFields :: [SubDecl] -> Html -subFields = divSubDecls "fields" "Fields" . subDlist +subFields :: Qualification -> [SubDecl] -> Html +subFields quali = divSubDecls "fields" "Fields" . (subDlist quali) -subInstances :: String -> [SubDecl] -> Html -subInstances nm = maybe noHtml wrap . instTable +subInstances :: Qualification -> String -> [SubDecl] -> Html +subInstances quali nm = maybe noHtml wrap . instTable where wrap = (subSection <<) . (subCaption +++) - instTable = fmap (thediv ! collapseSection id_ True [] <<) . subTable + instTable = fmap (thediv ! collapseSection id_ True [] <<) . (subTable quali) subSection = thediv ! [theclass $ "subs instances"] subCaption = paragraph ! collapseControl id_ True "caption" << "Instances" id_ = makeAnchorId $ "i:" ++ nm -- cgit v1.2.3