diff options
author | alexbiehl <alex.biehl@gmail.com> | 2017-08-29 07:55:38 +0200 |
---|---|---|
committer | alexbiehl <alex.biehl@gmail.com> | 2017-08-29 08:05:33 +0200 |
commit | 24ccb9b706e3555bf06f35e2f4007565d76fa1b8 (patch) | |
tree | 2b654e0f5b06aa5a16777a50ebcf32a1f35c6b36 /haddock-api/src/Haddock/Backends | |
parent | 9d1a32f264008700ebc6e29429b06606422fadda (diff) |
Include subordinates in content index
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-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 0297f9e7..80469929 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -374,19 +374,22 @@ ppJsonIndex odir maybe_source_url maybe_wiki_url unicode qual_opt ifaces = do mdl = ifaceMod iface goExport :: Module -> Qualification -> ExportItem DocName -> [Value] - goExport mdl qual item = - case processExport True links_info unicode qual item of - Nothing -> [] - Just html -> - [ Object - [ "display_html" .= String (showHtmlFragment html) + goExport mdl qual item + | Just item_html <- processExport True links_info unicode qual item + = [ Object + [ "display_html" .= String (showHtmlFragment item_html) , "name" .= String (intercalate " " (map nameString names)) , "module" .= String (moduleString mdl) , "link" .= String (fromMaybe "" (listToMaybe (map (nameLink mdl) names))) ] - ] + ] + | otherwise = [] where - names = exportName item + names = exportName item ++ exportSubs item + + exportSubs :: ExportItem DocName -> [DocName] + exportSubs ExportDecl { expItemSubDocs } = map fst expItemSubDocs + exportSubs _ = [] exportName :: ExportItem DocName -> [DocName] exportName ExportDecl { expItemDecl } = getMainDeclBinder $ unLoc expItemDecl |