[commit: haddock] ghc-head, ghc-head1, ie_avails, wip/T14529, wip/new-tree-one-param, 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, wip/ttg6-unrevert-2017-11-22: Render help documentation link next to (signature) in title. (4eb765c)

git at git.haskell.org git at git.haskell.org
Tue Nov 28 11:49:37 UTC 2017


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

On branches: ghc-head,ghc-head1,ie_avails,wip/T14529,wip/new-tree-one-param,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,wip/ttg6-unrevert-2017-11-22
Link       : http://git.haskell.org/haddock.git/commitdiff/4eb765ca4205c79539d60b7afa9b7e261a4a49fe

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

commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Wed Mar 22 14:11:25 2017 -0700

    Render help documentation link next to (signature) in title.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

4eb765ca4205c79539d60b7afa9b7e261a4a49fe
 haddock-api/resources/html/Ocean.std-theme/ocean.css | 5 +++++
 haddock-api/src/Haddock/Backends/Xhtml.hs            | 9 ++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css
index 3ebb14d..f816aec 100644
--- a/haddock-api/resources/html/Ocean.std-theme/ocean.css
+++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css
@@ -88,6 +88,11 @@ pre, code, kbd, samp, tt, .src {
   font-size: 182%; /* 24pt */
 }
 
+#module-header .caption sup {
+  font-size: 70%;
+  font-weight: normal;
+}
+
 .info  {
   font-size: 85%; /* 11pt */
 }
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 3b2842c..10b69a6 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -516,13 +516,17 @@ ppHtmlModule odir doctitle themes
       mdl_str_annot = mdl_str ++ if ifaceIsSig iface
                                     then " (signature)"
                                     else ""
+      mdl_str_linked = mdl_str +++
+                       " (signature" +++
+                       sup << ("[" +++ anchor ! [href signatureDocURL] << "?" +++ "]" ) +++
+                       ")"
       real_qual = makeModuleQual qual aliases mdl
       html =
         headHtml mdl_str_annot (Just $ "mini_" ++ moduleHtmlFile mdl) themes maybe_mathjax_url +++
         bodyHtml doctitle (Just iface)
           maybe_source_url maybe_wiki_url
           maybe_contents_url maybe_index_url << [
-            divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str_annot)),
+            divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str_linked)),
             ifaceToHtml maybe_source_url maybe_wiki_url iface unicode real_qual
           ]
 
@@ -530,6 +534,9 @@ ppHtmlModule odir doctitle themes
   writeFile (joinPath [odir, moduleHtmlFile mdl]) (renderToString debug html)
   ppHtmlModuleMiniSynopsis odir doctitle themes maybe_mathjax_url iface unicode real_qual debug
 
+signatureDocURL :: String
+signatureDocURL = "https://wiki.haskell.org/Module_signature"
+
 ppHtmlModuleMiniSynopsis :: FilePath -> String -> Themes
   -> Maybe String -> Interface -> Bool -> Qualification -> Bool -> IO ()
 ppHtmlModuleMiniSynopsis odir _doctitle themes maybe_mathjax_url iface unicode qual debug = do



More information about the ghc-commits mailing list