diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2017-03-13 03:13:10 -0700 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-23 17:20:08 -0400 |
commit | fbbe544c91020da143160bb8c68ee890d214a69e (patch) | |
tree | 6f65ff4cd9043ac7735e1f45e653bc2767bb17ba /haddock-api/src/Haddock | |
parent | 26879d9b4a2aba264a10812f2738d4db685d61d1 (diff) |
Render signature module tree separately from modules.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
(cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0)
Diffstat (limited to 'haddock-api/src/Haddock')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml.hs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 65b427f9..34911b11 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -263,13 +263,20 @@ ppHtmlContents dflags odir doctitle _maybe_package themes mathjax_url maybe_index_url maybe_source_url maybe_wiki_url ifaces showPkgs prologue debug qual = do let tree = mkModuleTree dflags showPkgs - [(instMod iface, toInstalledDescription iface) | iface <- ifaces] + [(instMod iface, toInstalledDescription iface) + | iface <- ifaces + , not (instIsSig iface)] + sig_tree = mkModuleTree dflags showPkgs + [(instMod iface, toInstalledDescription iface) + | iface <- ifaces + , instIsSig iface] html = headHtml doctitle Nothing themes mathjax_url +++ bodyHtml doctitle Nothing maybe_source_url maybe_wiki_url Nothing maybe_index_url << [ ppPrologue qual doctitle prologue, + ppSignatureTree qual sig_tree, ppModuleTree qual tree ] createDirectoryIfMissing True odir @@ -282,7 +289,13 @@ ppPrologue qual title (Just doc) = divDescription << (h1 << title +++ docElement thediv (rdrDocToHtml qual doc)) +ppSignatureTree :: Qualification -> [ModuleTree] -> Html +ppSignatureTree qual ts = + divModuleList << (sectionName << "Signatures" +++ mkNodeList qual [] "n" ts) + + ppModuleTree :: Qualification -> [ModuleTree] -> Html +ppModuleTree _ [] = mempty ppModuleTree qual ts = divModuleList << (sectionName << "Modules" +++ mkNodeList qual [] "n" ts) |