aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Hyperlinker.hs
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-26 22:41:07 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 22:37:49 +0200
commitd58bcf24dfa4333e7893935eb86c036be28125b1 (patch)
tree68a5c247d4944329041e97a07ebada46be3110b2 /haddock-api/src/Haddock/Backends/Hyperlinker.hs
parent844c09d0c1d724e0f0f0698654f2f85f5f58be19 (diff)
Make external hyperlinks point to locations specified by source URLs.
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hyperlinker.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
index 2ed4dbdd..6c66e0c6 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
@@ -1,10 +1,10 @@
module Haddock.Backends.Hyperlinker (ppHyperlinkedSource) where
import Haddock.Types
-import Haddock.Utils
import Haddock.Backends.Xhtml.Types
import Haddock.Backends.Xhtml.Utils
import Haddock.Backends.Hyperlinker.Renderer
+import Haddock.Backends.Hyperlinker.Utils
import Text.XHtml hiding ((</>))
@@ -29,7 +29,8 @@ ppHyperlinkedSource outdir libdir mstyle urls ifaces = do
ppHyperlinkedModuleSource :: FilePath -> SourceURLs -> Interface -> IO ()
ppHyperlinkedModuleSource outdir urls iface = case ifaceTokenizedSrc iface of
- Just tokens -> writeFile path $ showHtml . render mCssFile mJsFile $ tokens
+ Just tokens ->
+ writeFile path $ showHtml . render mCssFile mJsFile urls $ tokens
Nothing -> return ()
where
mCssFile = Just $ srcCssFile
@@ -49,6 +50,3 @@ highlightScript = "highlight.js"
defaultCssFile :: FilePath -> FilePath
defaultCssFile libdir = libdir </> "html" </> "solarized.css"
-
-srcModUrl :: SourceURLs -> String
-srcModUrl (_, mModSrcUrl, _, _) = fromMaybe defaultModuleSourceUrl mModSrcUrl