aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-02-12 10:04:22 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-12 10:04:22 +0100
commite18d166b39cdc8c6672b626b4b840c1c383a9685 (patch)
tree43aa1526b9980fdf9f6fc8cbd5a6027b9e82970c /haddock-api/src/Haddock.hs
parent57a5dcfd3d2a7e01229a2c3a79b1f99cd95d5de1 (diff)
parent6a6029f1fc7b2cfeea8e231c8806d293d6644004 (diff)
Merge remote-tracking branch 'origin/master' into ghc-head
Diffstat (limited to 'haddock-api/src/Haddock.hs')
-rw-r--r--haddock-api/src/Haddock.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 72a6cc92..5e8f4a4a 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -248,6 +248,9 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do
opt_latex_style = optLaTeXStyle flags
opt_source_css = optSourceCssFile flags
opt_mathjax = optMathjax flags
+ dflags'
+ | unicode = gopt_set dflags Opt_PrintUnicodeSyntax
+ | otherwise = dflags
visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ]
@@ -287,24 +290,24 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do
sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap')
libDir <- getHaddockLibDir flags
- prologue <- getPrologue dflags flags
+ prologue <- getPrologue dflags' flags
themes <- getThemes libDir flags >>= either bye return
when (Flag_GenIndex `elem` flags) $ do
ppHtmlIndex odir title pkgStr
- themes opt_contents_url sourceUrls' opt_wiki_urls
+ themes opt_mathjax opt_contents_url sourceUrls' opt_wiki_urls
allVisibleIfaces pretty
copyHtmlBits odir libDir themes
when (Flag_GenContents `elem` flags) $ do
- ppHtmlContents dflags odir title pkgStr
+ ppHtmlContents dflags' odir title pkgStr
themes opt_mathjax opt_index_url sourceUrls' opt_wiki_urls
allVisibleIfaces True prologue pretty
(makeContentsQual qual)
copyHtmlBits odir libDir themes
when (Flag_Html `elem` flags) $ do
- ppHtml dflags title pkgStr visibleIfaces odir
+ ppHtml dflags' title pkgStr visibleIfaces odir
prologue
themes opt_mathjax sourceUrls' opt_wiki_urls
opt_contents_url opt_index_url unicode qual
@@ -326,7 +329,7 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do
Just (PackageName pkgNameFS, pkgVer) ->
let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] = title
| otherwise = unpackFS pkgNameFS
- in ppHoogle dflags pkgNameStr pkgVer title (fmap _doc prologue)
+ in ppHoogle dflags' pkgNameStr pkgVer title (fmap _doc prologue)
visibleIfaces odir
when (Flag_LaTeX `elem` flags) $ do