diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-19 05:20:53 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-19 05:20:53 +0000 |
commit | d3ebf5f25ead73877b38302cbe8b1ed13e993917 (patch) | |
tree | c185060caab9a83c4fc0d41324bb90f26a7907b0 /src/Haddock/Backends/Html.hs | |
parent | a7aad74a978e2e1d313c23863c7a91983bbc4848 (diff) |
refactoring of anchor ID and fragment handling
Diffstat (limited to 'src/Haddock/Backends/Html.hs')
-rw-r--r-- | src/Haddock/Backends/Html.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs index 09d9fc5e..013f6bc4 100644 --- a/src/Haddock/Backends/Html.hs +++ b/src/Haddock/Backends/Html.hs @@ -729,8 +729,7 @@ processForMiniSynopsis _ _ _ = noHtml ppNameMini :: Module -> OccName -> Html ppNameMini mdl nm = - anchor ! [ href ( moduleHtmlFile mdl ++ "#" - ++ (escapeStr (anchorNameStr nm))) + anchor ! [ href (moduleNameUrl mdl nm) , target mainFrameName ] << ppBinder' nm @@ -1669,7 +1668,7 @@ ppDocName (Documented name mdl) = ppDocName (Undocumented name) = toHtml (getOccString name) linkTarget :: OccName -> Html -linkTarget n = namedAnchor (anchorNameStr n) << toHtml "" +linkTarget n = namedAnchor (nameAnchorId n) << toHtml "" ppName :: Name -> Html ppName name = toHtml (getOccString name) @@ -1678,7 +1677,7 @@ ppName name = toHtml (getOccString name) ppBinder :: Bool -> OccName -> Html -- The Bool indicates whether we are generating the summary, in which case -- the binder will be a link to the full definition. -ppBinder True n = linkedAnchor (anchorNameStr n) << ppBinder' n +ppBinder True n = linkedAnchor (nameAnchorId n) << ppBinder' n ppBinder False n = linkTarget n +++ bold << ppBinder' n @@ -1696,8 +1695,8 @@ linkIdOcc :: Module -> Maybe OccName -> Html -> Html linkIdOcc mdl mbName = anchor ! [href uri] where uri = case mbName of - Nothing -> moduleHtmlFile mdl - Just name -> nameHtmlRef mdl name + Nothing -> moduleUrl mdl + Just name -> moduleNameUrl mdl name ppModule :: Module -> String -> Html ppModule mdl ref = anchor ! [href ((moduleHtmlFile mdl) ++ ref)] |