diff options
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Names.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Names.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Haddock/Backends/Xhtml/Names.hs b/src/Haddock/Backends/Xhtml/Names.hs index 0c7df9a8..068fc0f7 100644 --- a/src/Haddock/Backends/Xhtml/Names.hs +++ b/src/Haddock/Backends/Xhtml/Names.hs @@ -17,6 +17,7 @@ module Haddock.Backends.Xhtml.Names ( linkId ) where + import Haddock.Backends.Xhtml.Utils import Haddock.GhcUtils import Haddock.Types @@ -28,21 +29,26 @@ import GHC import Name import RdrName + ppOccName :: OccName -> Html ppOccName = toHtml . occNameString + ppRdrName :: RdrName -> Html ppRdrName = ppOccName . rdrNameOcc + ppLDocName :: Located DocName -> Html ppLDocName (L _ d) = ppDocName d + ppDocName :: DocName -> Html ppDocName (Documented name mdl) = linkIdOcc mdl (Just occName) << ppOccName occName where occName = nameOccName name ppDocName (Undocumented name) = toHtml (getOccString name) + ppName :: Name -> Html ppName name = toHtml (getOccString name) @@ -72,13 +78,15 @@ linkIdOcc mdl mbName = anchor ! [href url] Nothing -> moduleUrl mdl Just name -> moduleNameUrl mdl name + ppModule :: Module -> Html ppModule mdl = anchor ! [href (moduleUrl mdl)] << toHtml (moduleString mdl) + ppModuleRef :: Module -> String -> Html ppModuleRef mdl ref = anchor ! [href (moduleUrl mdl ++ ref)] << toHtml (moduleString mdl) - -- NB: The ref paramaeter already includes the '#'. + -- NB: The ref parameter already includes the '#'. -- This function is only called from markupModule expanding a -- DocModule, which doesn't seem to be ever be used. |