diff options
author | Tobias Brandt <tob.brandt@gmail.com> | 2010-08-27 07:01:21 +0000 |
---|---|---|
committer | Tobias Brandt <tob.brandt@gmail.com> | 2010-08-27 07:01:21 +0000 |
commit | 2b87648737ad5b07e30d9bb03f7c4e3953566c24 (patch) | |
tree | 36454035a50838b558720351f0cd4886e19dfeb2 /src/Haddock/Backends/Xhtml/Layout.hs | |
parent | 957f4ad40b1eb9931d2b2de80f4bc8e28e22b4fa (diff) |
adding the option to fully qualify identifiers
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 34 |
1 files changed, 17 insertions, 17 deletions
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 |