From 57f25f23ffea2f36c0361a5155a8329c342b78da Mon Sep 17 00:00:00 2001 From: alexbiehl Date: Mon, 28 Aug 2017 18:47:43 +0200 Subject: Load javascript below the fold --- haddock-api/src/Haddock/Backends/Xhtml.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index e1bbee7b..0297f9e7 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -121,9 +121,6 @@ headHtml docTitle themes mathjax_url = thetitle << docTitle, styleSheet themes, script ! [src jsFile, thetype "text/javascript"] << noHtml, - script ! [src jsPreactFile, thetype "text/javascript"] << noHtml, - script ! [src jsFuseFile, thetype "text/javascript"] << noHtml, - script ! [src jsIndexFile, thetype "text/javascript"] << noHtml, script ! [src mjUrl, thetype "text/javascript"] << noHtml, script ! [thetype "text/javascript"] -- NB: Within XHTML, the content of script tags needs to be @@ -193,9 +190,12 @@ bodyHtml doctitle iface "Produced by " +++ (anchor ! [href projectUrl] << toHtml projectName) +++ (" version " ++ projectVersion) - ) - ] + ), + script ! [src jsPreactFile, thetype "text/javascript"] << noHtml, + script ! [src jsFuseFile, thetype "text/javascript"] << noHtml, + script ! [src jsIndexFile, thetype "text/javascript"] << noHtml + ] moduleInfo :: Interface -> Html moduleInfo iface = @@ -385,9 +385,9 @@ ppJsonIndex odir maybe_source_url maybe_wiki_url unicode qual_opt ifaces = do , "link" .= String (fromMaybe "" (listToMaybe (map (nameLink mdl) names))) ] ] - where + where names = exportName item - + exportName :: ExportItem DocName -> [DocName] exportName ExportDecl { expItemDecl } = getMainDeclBinder $ unLoc expItemDecl exportName ExportNoDecl { expItemName } = [expItemName] -- cgit v1.2.3