aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Hyperlinker.hs
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hyperlinker.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
index 66392a67..9337307c 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
@@ -16,14 +16,17 @@ ppHyperlinkedSource outdir libdir mstyle ifaces = do
createDirectoryIfMissing True $ srcPath outdir
let cssFile = fromMaybe (defaultCssFile libdir) mstyle
copyFile cssFile $ srcPath outdir </> srcCssFile
+ copyFile (libdir </> "html" </> highlightScript) $
+ srcPath outdir </> highlightScript
mapM_ (ppHyperlinkedModuleSource outdir) ifaces
ppHyperlinkedModuleSource :: FilePath -> Interface -> IO ()
ppHyperlinkedModuleSource outdir iface = case ifaceTokenizedSrc iface of
- Just tokens -> writeFile path $ showHtml . render mSrcCssFile $ tokens
+ Just tokens -> writeFile path $ showHtml . render mCssFile mJsFile $ tokens
Nothing -> return ()
where
- mSrcCssFile = Just $ srcCssFile
+ mCssFile = Just $ srcCssFile
+ mJsFile = Just $ highlightScript
path = srcPath outdir </> moduleSourceFile (ifaceMod iface)
moduleSourceFile :: Module -> FilePath
@@ -35,5 +38,8 @@ srcPath outdir = outdir </> "src"
srcCssFile :: FilePath
srcCssFile = "style.css"
+highlightScript :: FilePath
+highlightScript = "highlight.js"
+
defaultCssFile :: FilePath -> FilePath
defaultCssFile libdir = libdir </> "html" </> "solarized.css"