[commit: haddock] alexbiehl-patch-1, ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr-filter-maps, pr/cabal-desc, travis, v2.18, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Render signature module tree separately from modules. (fbbe544)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 21:06:03 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: alexbiehl-patch-1,ghc-head,ghc-head1,headdock-library-1.4.5,ie_avails,master,pr-filter-maps,pr/cabal-desc,travis,v2.18,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13
Link       : http://git.haskell.org/haddock.git/commitdiff/fbbe544c91020da143160bb8c68ee890d214a69e

>---------------------------------------------------------------

commit fbbe544c91020da143160bb8c68ee890d214a69e
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Mar 13 03:13:10 2017 -0700

    Render signature module tree separately from modules.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0)


>---------------------------------------------------------------

fbbe544c91020da143160bb8c68ee890d214a69e
 haddock-api/src/Haddock/Backends/Xhtml.hs | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 65b427f..34911b1 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)
 



More information about the ghc-commits mailing list