aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml.hs
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-10-08 19:38:21 +0200
committeralexbiehl <alex.biehl@gmail.com>2017-10-08 19:38:21 +0200
commit671b62d104751fd0ab8daf6b9cda1b971abf331f (patch)
tree43e1605c5e49ce0cf6d060fffb838f23e0e136aa /haddock-api/src/Haddock/Backends/Xhtml.hs
parent406030f2782590799e44470da7ca80e85f3cf026 (diff)
parente498b7871bfbee8b38858b546390246ddddb9509 (diff)
Merge remote-tracking branch 'origin/ghc-head' into HEAD
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index e8148782..1205e57c 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -44,6 +44,7 @@ import System.Directory
import Data.Map ( Map )
import qualified Data.Map as Map hiding ( Map )
import qualified Data.Set as Set hiding ( Set )
+import Data.Function
import Data.Ord ( comparing )
import DynFlags (Language(..))
@@ -559,6 +560,7 @@ ppHtmlModule odir doctitle themes
signatureDocURL :: String
signatureDocURL = "https://wiki.haskell.org/Module_signature"
+
ifaceToHtml :: SourceURLs -> WikiURLs -> Interface -> Bool -> Qualification -> Html
ifaceToHtml maybe_source_url maybe_wiki_url iface unicode qual
= ppModuleContents qual exports (not . null $ ifaceRnOrphanInstances iface) +++
@@ -610,7 +612,7 @@ ifaceToHtml maybe_source_url maybe_wiki_url iface unicode qual
ppModuleContents :: Qualification
- -> [ExportItem DocName]
+ -> [ExportItem DocNameI]
-> Bool -- ^ Orphans sections
-> Html
ppModuleContents qual exports orphan
@@ -626,7 +628,7 @@ ppModuleContents qual exports orphan
| orphan = [ linkedAnchor "section.orphans" << "Orphan instances" ]
| otherwise = []
- process :: Int -> [ExportItem DocName] -> ([Html],[ExportItem DocName])
+ process :: Int -> [ExportItem DocNameI] -> ([Html],[ExportItem DocNameI])
process _ [] = ([], [])
process n items@(ExportGroup lev id0 doc : rest)
| lev <= n = ( [], items )
@@ -643,9 +645,9 @@ ppModuleContents qual exports orphan
-- we need to assign a unique id to each section heading so we can hyperlink
-- them from the contents:
-numberSectionHeadings :: [ExportItem DocName] -> [ExportItem DocName]
+numberSectionHeadings :: [ExportItem DocNameI] -> [ExportItem DocNameI]
numberSectionHeadings = go 1
- where go :: Int -> [ExportItem DocName] -> [ExportItem DocName]
+ where go :: Int -> [ExportItem DocNameI] -> [ExportItem DocNameI]
go _ [] = []
go n (ExportGroup lev _ doc : es)
= ExportGroup lev (show n) doc : go (n+1) es
@@ -654,7 +656,7 @@ numberSectionHeadings = go 1
processExport :: Bool -> LinksInfo -> Bool -> Qualification
- -> ExportItem DocName -> Maybe Html
+ -> ExportItem DocNameI -> Maybe Html
processExport _ _ _ _ ExportDecl { expItemDecl = L _ (InstD _) } = Nothing -- Hide empty instances
processExport summary _ _ qual (ExportGroup lev id0 doc)
= nothingIf summary $ groupHeading lev id0 << docToHtml (Just id0) qual (mkMeta doc)