[commit: haddock] master: Create module with hyperlinker utility functions. (844c09d)
git at git.haskell.org
git at git.haskell.org
Wed Jul 8 08:40:31 UTC 2015
Repository : ssh://git@git.haskell.org/haddock
On branch : master
Link : http://git.haskell.org/haddock.git/commitdiff/844c09d0c1d724e0f0f0698654f2f85f5f58be19
>---------------------------------------------------------------
commit 844c09d0c1d724e0f0f0698654f2f85f5f58be19
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date: Fri Jun 26 22:24:57 2015 +0200
Create module with hyperlinker utility functions.
>---------------------------------------------------------------
844c09d0c1d724e0f0f0698654f2f85f5f58be19
haddock-api/haddock-api.cabal | 1 +
haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 216627c..7670f88 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -85,6 +85,7 @@ library
Haddock.Backends.HaddockDB
Haddock.Backends.Hoogle
Haddock.Backends.Hyperlinker
+ Haddock.Backends.Hyperlinker.Utils
Haddock.ModuleTree
Haddock.Types
Haddock.Doc
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
new file mode 100644
index 0000000..25ed942
--- /dev/null
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
@@ -0,0 +1,18 @@
+module Haddock.Backends.Hyperlinker.Utils
+ ( srcModUrl
+ , srcNameUrlMap
+ ) where
+
+import Haddock.Utils
+import Haddock.Backends.Xhtml.Types
+
+import GHC
+
+import Data.Maybe
+import Data.Map (Map)
+
+srcModUrl :: SourceURLs -> String
+srcModUrl (_, mModUrl, _, _) = fromMaybe defaultModuleSourceUrl mModUrl
+
+srcNameUrlMap :: SourceURLs -> Map PackageKey FilePath
+srcNameUrlMap (_, _, nameUrlMap, _) = nameUrlMap
More information about the ghc-commits
mailing list