diff options
| author | Alec Theriault <alec.theriault@gmail.com> | 2018-11-10 16:02:13 -0800 | 
|---|---|---|
| committer | Alec Theriault <alec.theriault@gmail.com> | 2018-11-10 16:02:13 -0800 | 
| commit | 959033d592b41235896402a64703650df77c34bd (patch) | |
| tree | 352d1c64c354017adc5b7c3c6aa7aa7fd95e1bf6 /haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | |
| parent | b62c9542480d629bb482f5394dec2fdd5a48af24 (diff) | |
| parent | f4d53a159642aa9182241259709659e7074425d5 (diff) | |
Merge branch 'ghc-8.6' into ghc-head
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml/Layout.hs')
| -rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 16 | 
1 files changed, 9 insertions, 7 deletions
| diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index 1c44ffda..25d8b07a 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -15,7 +15,7 @@ module Haddock.Backends.Xhtml.Layout (    divPackageHeader, divContent, divModuleHeader, divFooter,    divTableOfContents, divDescription, divSynopsis, divInterface, -  divIndex, divAlphabet, divModuleList, +  divIndex, divAlphabet, divModuleList, divContentsList,    sectionName,    nonEmptySectionName, @@ -74,13 +74,13 @@ sectionName = paragraph ! [theclass "caption"]  -- If it would have otherwise been empty, then give it the class ".empty".  nonEmptySectionName :: Html -> Html  nonEmptySectionName c -  | isNoHtml c = paragraph ! [theclass "caption empty"] $ spaceHtml -  | otherwise  = paragraph ! [theclass "caption"]       $ c +  | isNoHtml c = thespan ! [theclass "caption empty"] $ spaceHtml +  | otherwise  = thespan ! [theclass "caption"]       $ c  divPackageHeader, divContent, divModuleHeader, divFooter,    divTableOfContents, divDescription, divSynopsis, divInterface, -  divIndex, divAlphabet, divModuleList +  divIndex, divAlphabet, divModuleList, divContentsList      :: Html -> Html  divPackageHeader    = sectionDiv "package-header" @@ -88,6 +88,7 @@ divContent          = sectionDiv "content"  divModuleHeader     = sectionDiv "module-header"  divFooter           = sectionDiv "footer"  divTableOfContents  = sectionDiv "table-of-contents" +divContentsList     = sectionDiv "contents-list"  divDescription      = sectionDiv "description"  divSynopsis         = sectionDiv "synopsis"  divInterface        = sectionDiv "interface" @@ -195,17 +196,18 @@ subEquations :: Maybe Package -> Qualification -> [SubDecl] -> Html  subEquations pkg qual = divSubDecls "equations" "Equations" . subTable pkg qual --- | Generate sub table for instance declarations, with source +-- | Generate collapsible sub table for instance declarations, with source  subInstances :: Maybe Package -> Qualification               -> String -- ^ Class name, used for anchor generation               -> LinksInfo -> Bool               -> [(SubDecl, Maybe Module, Located DocName)] -> Html  subInstances pkg qual nm lnks splice = maybe noHtml wrap . instTable    where -    wrap contents = subSection (collapseDetails id_ DetailsOpen (summary +++ contents)) +    wrap contents = subSection (hdr +++ collapseDetails id_ DetailsOpen (summary +++ contents))      instTable = subTableSrc pkg qual lnks splice      subSection = thediv ! [theclass "subs instances"] -    summary = thesummary << "Instances" +    hdr = h4 ! collapseControl id_ "instances" << "Instances" +    summary = thesummary ! [ theclass "hide-when-js-enabled" ] << "Instances details"      id_ = makeAnchorId $ "i:" ++ nm | 
