diff options
author | Alexander Biehl <alexbiehl@gmail.com> | 2017-10-30 10:15:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 10:15:49 +0100 |
commit | 0f181c4a70ef5e4753545cd9e0734a015bb815e1 (patch) | |
tree | 7b36c544f1977438dc0fc7a728f8397ecd9202f2 /haddock-api/src/Haddock/Backends/Xhtml.hs | |
parent | aca68f620beb07f9bdebdf52948c6ea670be4980 (diff) |
Put Quickjump behind --quickjump flag (#697)
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml.hs')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index c76c0c88..8205f658 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -55,7 +55,6 @@ import Module -- * Generating HTML documentation -------------------------------------------------------------------------------- - ppHtml :: DynFlags -> String -- ^ Title -> Maybe String -- ^ Package @@ -71,12 +70,13 @@ ppHtml :: DynFlags -> Bool -- ^ Whether to use unicode in output (--use-unicode) -> QualOption -- ^ How to qualify names -> Bool -- ^ Output pretty html (newlines and indenting) + -> Bool -- ^ Also write Quickjump index -> IO () ppHtml dflags doctitle maybe_package ifaces odir prologue themes maybe_mathjax_url maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url unicode - qual debug = do + qual debug withQuickjump = do let visible_ifaces = filter visible ifaces visible i = OptHide `notElem` ifaceOptions i @@ -92,24 +92,27 @@ ppHtml dflags doctitle maybe_package ifaces odir prologue ppHtmlIndex odir doctitle maybe_package themes maybe_mathjax_url maybe_contents_url maybe_source_url maybe_wiki_url (map toInstalledIface visible_ifaces) debug - ppJsonIndex odir maybe_source_url maybe_wiki_url unicode qual - visible_ifaces + + when withQuickjump $ + ppJsonIndex odir maybe_source_url maybe_wiki_url unicode qual + visible_ifaces mapM_ (ppHtmlModule odir doctitle themes maybe_mathjax_url maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url unicode qual debug) visible_ifaces -copyHtmlBits :: FilePath -> FilePath -> Themes -> IO () -copyHtmlBits odir libdir themes = do +copyHtmlBits :: FilePath -> FilePath -> Themes -> Bool -> IO () +copyHtmlBits odir libdir themes withQuickjump = do let libhtmldir = joinPath [libdir, "html"] copyCssFile f = copyFile f (combine odir (takeFileName f)) copyLibFile f = copyFile (joinPath [libhtmldir, f]) (joinPath [odir, f]) mapM_ copyCssFile (cssFiles themes) - copyCssFile (joinPath [libhtmldir, quickJumpCssFile]) copyLibFile haddockJsFile - copyLibFile jsQuickJumpFile + when withQuickjump $ do + copyCssFile (joinPath [libhtmldir, quickJumpCssFile]) + copyLibFile jsQuickJumpFile return () |