aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/Names.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2010-07-21 14:17:32 +0000
committerDavid Waern <david.waern@gmail.com>2010-07-21 14:17:32 +0000
commit25013f63b6df88db06c8ee126686dbfe4655cd5c (patch)
treea7e03a302d870294ec82b64a37e5de5da3497abb /src/Haddock/Backends/Xhtml/Names.hs
parent6c589874c9fd4772880f758373852db83601dac6 (diff)
More style police
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Names.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/Names.hs10
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.