A
hunk ./src/Haddock/Backends/Html.hs 1592 --- gaw 2004 hunk ./src/Haddock/Backends/Html.hs 1603 +ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" hunk ./src/Haddock/Backends/Hoogle.hs 150 - tyVar (UserTyVar v) = v + tyVar (UserTyVar v _) = v hunk ./src/Haddock/Backends/Hoogle.hs 194 - ResTyH98 -> apps $ map (reL . HsTyVar) $ unL (tcdLName dat) : [x | UserTyVar x <- map unL $ tcdTyVars dat] + ResTyH98 -> apps $ map (reL . HsTyVar) $ unL (tcdLName dat) : [x | UserTyVar x _ <- map unL $ tcdTyVars dat] hunk ./src/Haddock/Backends/Html.hs 1360 -ppConstrHdr :: HsExplicitForAll -> [Name] -> HsContext DocName -> Bool -> Html +ppConstrHdr :: HsExplicitFlag -> [Name] -> HsContext DocName -> Bool -> Html hunk ./src/Haddock/Backends/Html.hs 1572 -ppForAll :: HsExplicitForAll -> [Located (HsTyVarBndr DocName)] +ppForAll :: HsExplicitFlag -> [Located (HsTyVarBndr DocName)] hunk ./src/Haddock/Backends/Html.hs 1603 -ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" hunk ./src/Haddock/Backends/Html.hs 1604 -ppr_mono_ty _ (HsRecTy _) _ = error "ppr_mono_ty HsRecTy" +ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy" hunk ./src/Haddock/Convert.hs 221 - then UserTyVar name + then UserTyVar name placeHolderKind hunk ./src/Haddock/Backends/Html.hs 1601 -ppr_mono_ty _ (HsSpliceTy _) _ = error "ppr_mono_ty HsSpliceTy" -ppr_mono_ty _ (HsSpliceTyOut _) _ = error "ppr_mono_ty HsSpliceTyOut" +ppr_mono_ty _ (HsSpliceTy {}) _ = error "ppr_mono_ty HsSpliceTy" +ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" hunk ./tests/runtests.hs 28 - result <- findProgramOnPath p silent + result <- findProgramOnPath silent p hunk ./tests/runtests.hs 73 - let basepath = init libdir ++ "/../../share/doc/ghc/libraries/base/" + let basepath = init libdir ++ "/../../share/doc/ghc/html/libraries/base/" hunk ./tests/runtests.hs 75 - let processpath = init libdir ++ "/../../share/doc/ghc/libraries/process/" + let processpath = init libdir ++ "/../../share/doc/ghc/html/libraries/process/" hunk ./tests/tests/CrossPackageDocs.hs 1 -module CrossPackageDocs (map, Monad(..), runInteractiveProcess {- $ Bugs -}) where +module CrossPackageDocs (map, Monad(..), runInteractiveProcess, MVar(..), newEmptyMVar {- $ Bugs -}) where hunk ./tests/tests/CrossPackageDocs.hs 4 +import GHC.MVar addfile ./tests/tests/CrossPackageDocs.html.ref hunk ./tests/tests/CrossPackageDocs.html.ref 1 + + +
| ||||||||||||||||||
| ||||||||||||||||||
| Synopsis | ||||||||||||||||||
| ||||||||||||||||||
| Documentation | ||||||||||||||||||
| map :: (a -> b) -> [a] -> [b] | ||||||||||||||||||
map f xs is the list obtained by applying f to each element + of xs, i.e., + map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] + map f [x1, x2, ...] == [f x1, f x2, ...] + | ||||||||||||||||||
| class Monad m where | ||||||||||||||||||
| ||||||||||||||||||
| runInteractiveProcess | ||||||||||||||||||
| ||||||||||||||||||
| data MVar a | ||||||||||||||||||
| ||||||||||||||||||
| newEmptyMVar :: IO (MVar a) | ||||||||||||||||||
| Create an MVar which is initially empty. + | ||||||||||||||||||
Bugs: +
| ||||||||||||||||||
| Produced by Haddock version 2.5.0 | ||||||||||||||||||
| An MVar (pronounced "em-var") is a synchronising variable, used -for communication between concurrent threads. It can be thought of -as a a box, which may be empty or full. - | ||
| Constructors | ||
| ||
Instances | ||
Bugs: -
| ||||||||||||
| ||||||||||||
| Documentation | ||||||||||||
| f | ||||||||||||
| ||||||||||||
| Produced by Haddock version 2.6.0 |
| :: a | First argument + |
| -> b | Second argument + |
| -> c | Third argument + |
| -> d | Result + |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| fib :: Integer -> Integer | ||||
Fibonacci number of given Integer. + Examples: +
One more Example: +
One more Example: +
Example with an import: +
| ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| data a :- b | ||||
| ||||
| f :: Int | ||||
| A reference to :- + | ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| f :: a | ||||
| url1 url2 + | ||||
| Produced by Haddock version 2.7.2 |
(this causes +-- ugly extra whitespace with some browsers). +docToHtml :: Doc DocName -> Html +docToHtml doc = markup htmlMarkup (markup htmlCleanup doc) + +origDocToHtml :: Doc Name -> Html +origDocToHtml doc = markup htmlOrigMarkup (markup htmlCleanup doc) + +rdrDocToHtml :: Doc RdrName -> Html +rdrDocToHtml doc = markup htmlRdrMarkup (markup htmlCleanup doc) + +-- If there is a single paragraph, then surrounding it with
..
+-- can add too much whitespace in some browsers (eg. IE). However if +-- we have multiple paragraphs, then we want the extra whitespace to +-- separate them. So we catch the single paragraph case and transform it +-- here. +unParagraph :: Doc a -> Doc a +unParagraph (DocParagraph d) = d +--NO: This eliminates line breaks in the code block: (SDM, 6/5/2003) +--unParagraph (DocCodeBlock d) = (DocMonospaced d) +unParagraph doc = doc + +htmlCleanup :: DocMarkup a (Doc a) +htmlCleanup = idMarkup { + markupUnorderedList = DocUnorderedList . map unParagraph, + markupOrderedList = DocOrderedList . map unParagraph + } addfile ./src/Haddock/Backends/Xhtml/Layout.hs hunk ./src/Haddock/Backends/Xhtml/Layout.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : Haddock.Backends.Html.Layout +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2009, +-- Mark Lentczner 2010 +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +----------------------------------------------------------------------------- + +module Haddock.Backends.Xhtml.Layout where + +import Haddock.Backends.Xhtml.DocMarkup +import Haddock.Backends.Xhtml.Types +import Haddock.Backends.Xhtml.Util +import Haddock.Types + +import Text.XHtml hiding ( name, title, p, quote ) + +import FastString ( unpackFS ) +import GHC + + +declWithDoc :: Bool -> LinksInfo -> SrcSpan -> DocName -> Maybe (Doc DocName) -> Html -> HtmlTable +declWithDoc True _ _ _ _ html_decl = declBox html_decl +declWithDoc False links loc nm Nothing html_decl = topDeclBox links loc nm html_decl +declWithDoc False links loc nm (Just doc) html_decl = + topDeclBox links loc nm html_decl > docBox (docToHtml doc) + + + +{- +text :: Html +text = strAttr "TEXT" +-} + +-- a box for displaying code +declBox :: Html -> HtmlTable +declBox html = tda [theclass "decl"] << html + +-- a box for top level documented names +-- it adds a source and wiki link at the right hand side of the box +topDeclBox :: LinksInfo -> SrcSpan -> DocName -> Html -> HtmlTable +topDeclBox ((_,_,Nothing), (_,_,Nothing)) _ _ html = declBox html +topDeclBox ((_,_,maybe_source_url), (_,_,maybe_wiki_url)) + loc name html = + tda [theclass "topdecl"] << + ( table ! [theclass "declbar"] << + ((tda [theclass "declname"] << html) + <-> srcLink + <-> wikiLink) + ) + where srcLink = + case maybe_source_url of + Nothing -> emptyTable + Just url -> tda [theclass "declbut"] << + let url' = spliceURL (Just fname) (Just origMod) + (Just n) (Just loc) url + in anchor ! [href url'] << toHtml "Source" + + wikiLink = + case maybe_wiki_url of + Nothing -> emptyTable + Just url -> tda [theclass "declbut"] << + let url' = spliceURL (Just fname) (Just mdl) + (Just n) (Just loc) url + in anchor ! [href url'] << toHtml "Comments" + + -- For source links, we want to point to the original module, + -- because only that will have the source. + -- TODO: do something about type instances. They will point to + -- the module defining the type family, which is wrong. + origMod = nameModule n + + -- Name must be documented, otherwise we wouldn't get here + Documented n mdl = name + + fname = unpackFS (srcSpanFile loc) + + +-- a box for displaying an 'argument' (some code which has text to the +-- right of it). Wrapping is not allowed in these boxes, whereas it is +-- in a declBox. +argBox :: Html -> HtmlTable +argBox html = tda [theclass "arg"] << html + +-- a box for displaying documentation, +-- indented and with a little padding at the top +docBox :: Html -> HtmlTable +docBox html = tda [theclass "doc"] << html + +-- a box for displaying documentation, not indented. +ndocBox :: Html -> HtmlTable +ndocBox html = tda [theclass "ndoc"] << html + +-- a box for displaying documentation, padded on the left a little +rdocBox :: Html -> HtmlTable +rdocBox html = tda [theclass "rdoc"] << html + +maybeRDocBox :: Maybe (Doc DocName) -> HtmlTable +maybeRDocBox Nothing = rdocBox (noHtml) +maybeRDocBox (Just doc) = rdocBox (docToHtml doc) + + +bodyBox :: Html -> HtmlTable +bodyBox html = tda [theclass "body"] << vanillaTable << html + +-- a vanilla table has width 100%, no border, no padding, no spacing +vanillaTable, vanillaTable2 :: Html -> Html +vanillaTable = table ! [theclass "vanilla", cellspacing 0, cellpadding 0] +vanillaTable2 = table ! [theclass "vanilla2", cellspacing 0, cellpadding 0] + +spacedTable1, spacedTable5 :: Html -> Html +spacedTable1 = table ! [theclass "vanilla", cellspacing 1, cellpadding 0] +spacedTable5 = table ! [theclass "vanilla", cellspacing 5, cellpadding 0] + +constrHdr, methHdr, atHdr :: HtmlTable +constrHdr = tda [ theclass "section4" ] << toHtml "Constructors" +methHdr = tda [ theclass "section4" ] << toHtml "Methods" +atHdr = tda [ theclass "section4" ] << toHtml "Associated Types" + +instHdr :: String -> HtmlTable +instHdr id_ = + tda [ theclass "section4" ] << (collapsebutton id_ +++ toHtml " Instances") addfile ./src/Haddock/Backends/Xhtml/Names.hs hunk ./src/Haddock/Backends/Xhtml/Names.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : Haddock.Backends.Html.Names +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2009, +-- Mark Lentczner 2010 +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +----------------------------------------------------------------------------- + +module Haddock.Backends.Xhtml.Names where + +import Haddock.Backends.Xhtml.Util +import Haddock.GhcUtils +import Haddock.Types +import Haddock.Utils + +import Text.XHtml hiding ( name, title, p, quote ) + +import GHC +import Name +import RdrName + +ppOccName :: OccName -> Html +ppOccName = toHtml . occNameString + +ppRdrName :: RdrName -> Html +ppRdrName = ppOccName . rdrNameOcc + +ppLDocName :: Located DocName -> Html +ppLDocName (L _ d) = ppDocName d + +ppDocName :: DocName -> Html +ppDocName (Documented name mdl) = + linkIdOcc mdl (Just occName) << ppOccName occName + where occName = nameOccName name +ppDocName (Undocumented name) = toHtml (getOccString name) + +linkTarget :: OccName -> Html +linkTarget n = namedAnchor (anchorNameStr n) << toHtml "" + +ppName :: Name -> Html +ppName name = toHtml (getOccString name) + + +ppBinder :: Bool -> OccName -> Html +-- The Bool indicates whether we are generating the summary, in which case +-- the binder will be a link to the full definition. +ppBinder True n = linkedAnchor (anchorNameStr n) << ppBinder' n +ppBinder False n = linkTarget n +++ bold << ppBinder' n + + +ppBinder' :: OccName -> Html +ppBinder' n + | isVarSym n = parens $ ppOccName n + | otherwise = ppOccName n + + +linkId :: Module -> Maybe Name -> Html -> Html +linkId mdl mbName = linkIdOcc mdl (fmap nameOccName mbName) + + +linkIdOcc :: Module -> Maybe OccName -> Html -> Html +linkIdOcc mdl mbName = anchor ! [href uri] + where + uri = case mbName of + Nothing -> moduleHtmlFile mdl + Just name -> nameHtmlRef mdl name + +ppModule :: Module -> String -> Html +ppModule mdl ref = anchor ! [href ((moduleHtmlFile mdl) ++ ref)] + << toHtml (moduleString mdl) + addfile ./src/Haddock/Backends/Xhtml/Types.hs hunk ./src/Haddock/Backends/Xhtml/Types.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : Haddock.Backends.Html.Types +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2009, +-- Mark Lentczner 2010 +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +----------------------------------------------------------------------------- + +module Haddock.Backends.Xhtml.Types where + + +-- the base, module and entity URLs for the source code and wiki links. +type SourceURLs = (Maybe String, Maybe String, Maybe String) +type WikiURLs = (Maybe String, Maybe String, Maybe String) + +-- The URL for source and wiki links, and the current module +type LinksInfo = (SourceURLs, WikiURLs) addfile ./src/Haddock/Backends/Xhtml/Util.hs hunk ./src/Haddock/Backends/Xhtml/Util.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : Haddock.Backends.Html.Util +-- Copyright : (c) Simon Marlow 2003-2006, +-- David Waern 2006-2009, +-- Mark Lentczner 2010 +-- License : BSD-like +-- +-- Maintainer : haddock@projects.haskell.org +-- Stability : experimental +-- Portability : portable +----------------------------------------------------------------------------- + +module Haddock.Backends.Xhtml.Util where + +import Haddock.GhcUtils +import Haddock.Utils + +import Data.Maybe + +import Text.XHtml hiding ( name, title, p, quote ) +import qualified Text.XHtml as Html + +import GHC ( SrcSpan, srcSpanStartLine, Name ) +import Module ( Module ) +import Name ( getOccString, nameOccName, isValOcc ) + + +spliceURL :: Maybe FilePath -> Maybe Module -> Maybe GHC.Name -> + Maybe SrcSpan -> String -> String +spliceURL maybe_file maybe_mod maybe_name maybe_loc url = run url + where + file = fromMaybe "" maybe_file + mdl = case maybe_mod of + Nothing -> "" + Just m -> moduleString m + + (name, kind) = + case maybe_name of + Nothing -> ("","") + Just n | isValOcc (nameOccName n) -> (escapeStr (getOccString n), "v") + | otherwise -> (escapeStr (getOccString n), "t") + + line = case maybe_loc of + Nothing -> "" + Just span_ -> show $ srcSpanStartLine span_ + + run "" = "" + run ('%':'M':rest) = mdl ++ run rest + run ('%':'F':rest) = file ++ run rest + run ('%':'N':rest) = name ++ run rest + run ('%':'K':rest) = kind ++ run rest + run ('%':'L':rest) = line ++ run rest + run ('%':'%':rest) = "%" ++ run rest + + run ('%':'{':'M':'O':'D':'U':'L':'E':'}':rest) = mdl ++ run rest + run ('%':'{':'F':'I':'L':'E':'}':rest) = file ++ run rest + run ('%':'{':'N':'A':'M':'E':'}':rest) = name ++ run rest + run ('%':'{':'K':'I':'N':'D':'}':rest) = kind ++ run rest + + run ('%':'{':'M':'O':'D':'U':'L':'E':'/':'.':'/':c:'}':rest) = + map (\x -> if x == '.' then c else x) mdl ++ run rest + + run ('%':'{':'F':'I':'L':'E':'/':'/':'/':c:'}':rest) = + map (\x -> if x == '/' then c else x) file ++ run rest + + run ('%':'{':'L':'I':'N':'E':'}':rest) = line ++ run rest + + run (c:rest) = c : run rest + + +renderToString :: Html -> String +-- renderToString = showHtml -- for production +renderToString = prettyHtml -- for debugging + +hsep :: [Html] -> Html +hsep [] = noHtml +hsep htmls = foldr1 (\a b -> a+++" "+++b) htmls + +infixr 8 <+>, <++> +(<+>) :: Html -> Html -> Html +a <+> b = a +++ toHtml " " +++ b + +(<++>) :: Html -> Html -> Html +a <++> b = a +++ spaceHtml +++ b + +keyword :: String -> Html +keyword s = thespan ! [theclass "keyword"] << toHtml s + +equals, comma :: Html +equals = char '=' +comma = char ',' + +char :: Char -> Html +char c = toHtml [c] + +empty :: Html +empty = noHtml + + +quote :: Html -> Html +quote h = char '`' +++ h +++ '`' + + +parens, brackets, pabrackets, braces :: Html -> Html +parens h = char '(' +++ h +++ char ')' +brackets h = char '[' +++ h +++ char ']' +pabrackets h = toHtml "[:" +++ h +++ toHtml ":]" +braces h = char '{' +++ h +++ char '}' + +punctuate :: Html -> [Html] -> [Html] +punctuate _ [] = [] +punctuate h (d0:ds) = go d0 ds + where + go d [] = [d] + go d (e:es) = (d +++ h) : go e es + +abovesSep :: HtmlTable -> [HtmlTable] -> HtmlTable +abovesSep _ [] = emptyTable +abovesSep h (d0:ds) = go d0 ds + where + go d [] = d + go d (e:es) = d > h > go e es + +parenList :: [Html] -> Html +parenList = parens . hsep . punctuate comma + +ubxParenList :: [Html] -> Html +ubxParenList = ubxparens . hsep . punctuate comma + +ubxparens :: Html -> Html +ubxparens h = toHtml "(#" +++ h +++ toHtml "#)" + + +tda :: [HtmlAttr] -> Html -> HtmlTable +tda as = cell . (td ! as) + +emptyTable :: HtmlTable +emptyTable = cell noHtml + +onclick :: String -> HtmlAttr +onclick = strAttr "onclick" + + +dcolon, arrow, darrow, forallSymbol :: Bool -> Html +dcolon unicode = toHtml (if unicode then "∷" else "::") +arrow unicode = toHtml (if unicode then "→" else "->") +darrow unicode = toHtml (if unicode then "⇒" else "=>") +forallSymbol unicode = if unicode then toHtml "∀" else keyword "forall" + + +dot :: Html +dot = toHtml "." + + +s8 :: HtmlTable +s8 = tda [ theclass "s8" ] << noHtml + + +-- | Generate a named anchor +-- +-- This actually generates two anchor tags, one with the name unescaped, and one +-- with the name URI-escaped. This is needed because Opera 9.52 (and later +-- versions) needs the name to be unescaped, while IE 7 needs it to be escaped. +-- +namedAnchor :: String -> Html -> Html +namedAnchor n c = anchor ! [Html.name n] << noHtml +++ + anchor ! [Html.name (escapeStr n)] << c + + +-- +-- A section of HTML which is collapsible via a +/- button. +-- + +-- TODO: Currently the initial state is non-collapsed. Change the 'minusFile' +-- below to a 'plusFile' and the 'display:block;' to a 'display:none;' when we +-- use cookies from JavaScript to have a more persistent state. + +collapsebutton :: String -> Html +collapsebutton id_ = + image ! [ src minusFile, theclass "coll", onclick ("toggle(this,'" ++ id_ ++ "')"), alt "show/hide" ] + +collapsed :: (HTML a) => (Html -> Html) -> String -> a -> Html +collapsed fn id_ html = + fn ! [identifier id_, thestyle "display:block;"] << html + +-- A quote is a valid part of a Haskell identifier, but it would interfere with +-- the ECMA script string delimiter used in collapsebutton above. +collapseId :: Name -> String +collapseId nm = "i:" ++ escapeStr (getOccString nm) + +linkedAnchor :: String -> Html -> Html +linkedAnchor frag = anchor ! [href hr_] + where hr_ | null frag = "" + | otherwise = '#': escapeStr frag + +documentCharacterEncoding :: Html +documentCharacterEncoding = + meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"] + +styleSheet :: Html +styleSheet = + (thelink ! [href cssFile, rel "stylesheet", thetype "text/css"]) noHtml hunk ./src/Haddock/Options.hs 80 + | Flag_Xhtml hunk ./src/Haddock/Options.hs 117 + Option [] ["xhtml"] (NoArg Flag_Xhtml) "use experimental XHTML rendering", hunk ./src/Main.hs 21 -import Haddock.Backends.Html +import qualified Haddock.Backends.Html as Html +import qualified Haddock.Backends.Xhtml as Xhtml hunk ./src/Main.hs 222 + -- which HTML redering to use + pick htmlF xhtmlF = if (Flag_Xhtml `elem` flags) then xhtmlF else htmlF + ppHtmlIndex = pick Html.ppHtmlIndex Xhtml.ppHtmlIndex + ppHtmlHelpFiles = pick Html.ppHtmlHelpFiles Xhtml.ppHtmlHelpFiles + ppHtmlContents = pick Html.ppHtmlContents Xhtml.ppHtmlContents + ppHtml = pick Html.ppHtml Xhtml.ppHtml + copyHtmlBits = pick Html.copyHtmlBits Xhtml.copyHtmlBits hunk ./tests/golden-tests/README 27 +You can pass extra options to haddock like so + runhaskell runtests.hs --xhtml all + hunk ./tests/golden-tests/runtests.hs 68 - + let (opts, spec) = span ("-" `isPrefixOf`) args hunk ./tests/golden-tests/runtests.hs 70 - case args of + case spec of hunk ./tests/golden-tests/runtests.hs 93 - handle <- runProcess "../dist/build/haddock/haddock" (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts", "--optghc=-w", base, process] ++ mods') Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing + handle <- runProcess "../dist/build/haddock/haddock" (["-w", "-o", outdir, "-h", "--optghc=-fglasgow-exts", "--optghc=-w", base, process] ++ opts ++ mods') Nothing (Just [("haddock_datadir", "../.")]) Nothing Nothing Nothing hunk ./src/Haddock/Backends/Xhtml/Decl.hs 600 +#if __GLASGOW_HASKELL__ == 612 hunk ./src/Haddock/Backends/Xhtml/Decl.hs 602 +#else +ppConstrHdr :: HsExplicitFlag -> [Name] -> HsContext DocName -> Bool -> Html +#endif hunk ./src/Haddock/Backends/Xhtml/Decl.hs 816 +#if __GLASGOW_HASKELL__ == 612 hunk ./src/Haddock/Backends/Xhtml/Decl.hs 818 +#else +ppForAll :: HsExplicitFlag -> [Located (HsTyVarBndr DocName)] +#endif hunk ./src/Haddock/Backends/Xhtml/Decl.hs 840 --- gaw 2004 hunk ./src/Haddock/Backends/Xhtml/Decl.hs 849 -ppr_mono_ty _ (HsSpliceTy _) _ = error "ppr_mono_ty HsSpliceTy" -ppr_mono_ty _ (HsSpliceTyOut _) _ = error "ppr_mono_ty HsSpliceTyOut" -ppr_mono_ty _ (HsRecTy _) _ = error "ppr_mono_ty HsRecTy" - +ppr_mono_ty _ (HsSpliceTy {}) _ = error "ppr_mono_ty HsSpliceTy" +#if __GLASGOW_HASKELL__ == 612 +ppr_mono_ty _ (HsSpliceTyOut {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" +#else +ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" +#endif +ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy" hunk ./haddock.cabal 113 + Haddock.Backends.Xhtml + Haddock.Backends.Xhtml.Decl + Haddock.Backends.Xhtml.DocMarkup + Haddock.Backends.Xhtml.Layout + Haddock.Backends.Xhtml.Names + Haddock.Backends.Xhtml.Types + Haddock.Backends.Xhtml.Util hunk ./haddock.cabal 142 + xhtml >= 3000.2 && < 3000.3, hunk ./haddock.cabal 179 + Haddock.Backends.Xhtml + Haddock.Backends.Xhtml.Decl + Haddock.Backends.Xhtml.DocMarkup + Haddock.Backends.Xhtml.Layout + Haddock.Backends.Xhtml.Names + Haddock.Backends.Xhtml.Types + Haddock.Backends.Xhtml.Util hunk ./src/Haddock/Backends/Hoogle.hs 242 - markupAName = const $ str "" + markupAName = const $ str "", + markupExample = box TagPre . str . unlines . (map exampleToString) hunk ./src/Haddock/Backends/Html.hs 1725 - markupAName = \aname -> namedAnchor aname << toHtml "" + markupAName = \aname -> namedAnchor aname << toHtml "", + markupExample = examplesToHtml hunk ./src/Haddock/Backends/Html.hs 1740 + examplesToHtml l = (pre $ concatHtml $ map exampleToHtml l) ! [theclass "screen"] + + exampleToHtml (Example expression result) = htmlExample + where + htmlExample = htmlPrompt +++ htmlExpression +++ (toHtml $ unlines result) + htmlPrompt = (thecode . toHtml $ "ghci> ") ! [theclass "prompt"] + htmlExpression = (strong . thecode . toHtml $ expression ++ "\n") ! [theclass "userinput"] + hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 45 - markupAName = \aname -> namedAnchor aname << toHtml "" + markupAName = \aname -> namedAnchor aname << toHtml "", + markupExample = examplesToHtml hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 60 + examplesToHtml l = (pre $ concatHtml $ map exampleToHtml l) ! [theclass "screen"] + + exampleToHtml (Example expression result) = htmlExample + where + htmlExample = htmlPrompt +++ htmlExpression +++ (toHtml $ unlines result) + htmlPrompt = (thecode . toHtml $ "ghci> ") ! [theclass "prompt"] + htmlExpression = (strong . thecode . toHtml $ expression ++ "\n") ! [theclass "userinput"] + hunk ./src/Haddock/Interface/Rename.hs 204 + DocExamples e -> return (DocExamples e) hunk ./src/Haddock/Interface/Rn.hs 83 + DocExamples e -> return (DocExamples e) + hunk ./src/Haddock/InterfaceFile.hs 380 +instance Binary Example where + put_ bh (Example expression result) = do + put_ bh expression + put_ bh result + get bh = do + expression <- get bh + result <- get bh + return (Example expression result) + + hunk ./src/Haddock/InterfaceFile.hs 437 + put_ bh (DocExamples ao) = do + putByte bh 15 + put_ bh ao hunk ./src/Haddock/InterfaceFile.hs 488 + 15 -> do + ao <- get bh + return (DocExamples ao) hunk ./src/Haddock/Lex.x 48 + $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } hunk ./src/Haddock/Lex.x 71 +
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| f :: a | ||||
| ...given a raw Addr# to the string, and the length of the string. + | ||||
| Produced by Haddock version 2.7.2 |
..
--- can add too much whitespace in some browsers (eg. IE). However if --- we have multiple paragraphs, then we want the extra whitespace to --- separate them. So we catch the single paragraph case and transform it --- here. -unParagraph :: Doc a -> Doc a -unParagraph (DocParagraph d) = d ---NO: This eliminates line breaks in the code block: (SDM, 6/5/2003) ---unParagraph (DocCodeBlock d) = (DocMonospaced d) -unParagraph doc = doc hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 85 -htmlCleanup :: DocMarkup a (Doc a) -htmlCleanup = idMarkup { - markupUnorderedList = DocUnorderedList . map unParagraph, - markupOrderedList = DocOrderedList . map unParagraph - } +cleanup :: Doc a -> Doc a +cleanup = markup fmtUnParagraphLists + where + -- If there is a single paragraph, then surrounding it with..
+ -- can add too much whitespace in some browsers (eg. IE). However if + -- we have multiple paragraphs, then we want the extra whitespace to + -- separate them. So we catch the single paragraph case and transform it + -- here. We don't do this in code blocks as it eliminates line breaks. + unParagraph :: Doc a -> Doc a + unParagraph (DocParagraph d) = d + unParagraph doc = doc + + fmtUnParagraphLists :: DocMarkup a (Doc a) + fmtUnParagraphLists = idMarkup { + markupUnorderedList = DocUnorderedList . map unParagraph, + markupOrderedList = DocOrderedList . map unParagraph + } hunk ./src/Haddock/Backends/Xhtml/Util.hs 73 --- renderToString = showHtml -- for production -renderToString = prettyHtml -- for debugging +renderToString = showHtml -- for production +--renderToString = prettyHtml -- for debugging hunk ./html/xhaddock.css 54 - padding-left: 3em; + padding-left: 10px; + margin-left: 2.5em; hunk ./html/xhaddock.css 150 + margin-left: 10px; hunk ./html/xhaddock.css 154 -div.table-of-contents ul ul { - margin-left: 2.5em; -} - hunk ./html/xhaddock.css 157 + margin-left: 10px; hunk ./html/xhaddock.css 166 - margin-left: 10px; hunk ./src/Haddock/Backends/Xhtml.hs 297 - docBox (rdrDocToHtml doc) + (tda [theclass "doc"] << (rdrDocToHtml doc)) hunk ./src/Haddock/Backends/Xhtml.hs 739 - = Right $ ppDecl' summary links decl doc insts subdocs unicode + = Right $ ppDecl summary links decl doc insts subdocs unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 36 -ppDecl' :: Bool -> LinksInfo -> LHsDecl DocName -> - DocForDecl DocName -> [DocInstance DocName] -> [(DocName, DocForDecl DocName)] -> Bool -> Html -ppDecl' s k l m i d u = vanillaTable << ppDecl s k l m i d u - hunk ./src/Haddock/Backends/Xhtml/Decl.hs 37 - DocForDecl DocName -> [DocInstance DocName] -> [(DocName, DocForDecl DocName)] -> Bool -> HtmlTable + DocForDecl DocName -> [DocInstance DocName] -> [(DocName, DocForDecl DocName)] -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 49 - InstD _ -> emptyTable + InstD _ -> noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 53 - DocName -> HsType DocName -> Bool -> HtmlTable + DocName -> HsType DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 61 - DocForDecl DocName -> (Html, Html, Html) -> Bool -> HtmlTable + DocForDecl DocName -> (Html, Html, Html) -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 64 - | otherwise = topDeclBox links loc docname pref2 > - (tda [theclass "body"] << vanillaTable << ( + | otherwise = topDeclElem links loc docname pref2 +++ + (vanillaTable << ( hunk ./src/Haddock/Backends/Xhtml/Decl.hs 109 -ppFor :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> ForeignDecl DocName -> Bool -> HtmlTable +ppFor :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> ForeignDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 116 -ppTySyn :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> TyClDecl DocName -> Bool -> HtmlTable +ppTySyn :: Bool -> LinksInfo -> SrcSpan -> DocForDecl DocName -> TyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 162 - TyClDecl DocName -> Bool -> HtmlTable + TyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 166 - (ppTyFamHeader True associated decl unicode) - - | associated, isJust mbDoc = header_ > bodyBox << doc - | associated = header_ - | null instances, isJust mbDoc = header_ > bodyBox << doc - | null instances = header_ - | isJust mbDoc = header_ > bodyBox << (doc > instancesBit) - | otherwise = header_ > bodyBox << instancesBit + (ppTyFamHeader True associated decl unicode) + | otherwise = header_ +++ maybeDocToHtml mbDoc +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 172 - header_ = topDeclBox links loc docname (ppTyFamHeader summary associated decl unicode) - - doc = ndocBox . docToHtml . fromJust $ mbDoc + header_ = topDeclElem links loc docname (ppTyFamHeader summary associated decl unicode) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 176 - instancesBit = instHdr instId > + instancesBit + | associated || null instances = noHtml + | otherwise = vanillaTable << ( + instHdr instId > hunk ./src/Haddock/Backends/Xhtml/Decl.hs 186 + ) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 215 - TyClDecl DocName -> Bool -> HtmlTable + TyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 220 - - | isJust mbDoc = header_ > bodyBox << doc - | otherwise = header_ + | otherwise = header_ +++ maybeDocToHtml mbDoc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 225 - header_ = topDeclBox links loc docname (ppTyInstHeader summary associated decl unicode) - - doc = case mbDoc of - Just d -> ndocBox (docToHtml d) - Nothing -> emptyTable + header_ = topDeclElem links loc docname (ppTyInstHeader summary associated decl unicode) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 241 -ppAssocType :: Bool -> LinksInfo -> DocForDecl DocName -> LTyClDecl DocName -> Bool -> HtmlTable +ppAssocType :: Bool -> LinksInfo -> DocForDecl DocName -> LTyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 348 -ppShortClassDecl :: Bool -> LinksInfo -> TyClDecl DocName -> SrcSpan -> [(DocName, DocForDecl DocName)] -> Bool -> HtmlTable +ppShortClassDecl :: Bool -> LinksInfo -> TyClDecl DocName -> SrcSpan -> [(DocName, DocForDecl DocName)] -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 351 - then (if summary then declBox else topDeclBox links loc nm) hdr - else (if summary then declBox else topDeclBox links loc nm) (hdr <+> keyword "where") - > + then (if summary then declElem else topDeclElem links loc nm) hdr + else (if summary then declElem else topDeclElem links loc nm) (hdr <+> keyword "where") + +++ vanillaTable << hunk ./src/Haddock/Backends/Xhtml/Decl.hs 355 - bodyBox << - aboves - ( - [ ppAssocType summary links doc at unicode | at <- ats - , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ] ++ + bodyBox << aboves + ( + [ ppAssocType summary links doc at unicode | at <- ats + , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ] ++ hunk ./src/Haddock/Backends/Xhtml/Decl.hs 360 - [ ppFunSig summary links loc doc n typ unicode - | L _ (TypeSig (L _ n) (L _ typ)) <- sigs - , let doc = lookupAnySubdoc n subdocs ] - ) - ) + [ ppFunSig summary links loc doc n typ unicode + | L _ (TypeSig (L _ n) (L _ typ)) <- sigs + , let doc = lookupAnySubdoc n subdocs ] + ) + ) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 374 - -> TyClDecl DocName -> Bool -> HtmlTable + -> TyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 376 - decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ ats _) unicode + decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ _ _) unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 378 - | otherwise = classheader > bodyBox << (classdoc > body_ > instancesBit) + | otherwise = classheader +++ maybeDocToHtml mbDoc +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 381 - | null lsigs = topDeclBox links loc nm (hdr unicode) - | otherwise = topDeclBox links loc nm (hdr unicode <+> keyword "where") + | null lsigs = topDeclElem links loc nm (hdr unicode) + | otherwise = topDeclElem links loc nm (hdr unicode <+> keyword "where") hunk ./src/Haddock/Backends/Xhtml/Decl.hs 387 - - classdoc = case mbDoc of - Nothing -> emptyTable - Just d -> ndocBox (docToHtml d) - - body_ - | null lsigs, null ats = emptyTable - | null ats = s8 > methHdr > bodyBox << methodTable - | otherwise = s8 > atHdr > bodyBox << atTable > - s8 > methHdr > bodyBox << methodTable - - methodTable = - abovesSep s8 [ ppFunSig summary links loc doc n typ unicode - | L _ (TypeSig (L _ n) (L _ typ)) <- lsigs - , let doc = lookupAnySubdoc n subdocs ] - - atTable = abovesSep s8 $ [ ppAssocType summary links doc at unicode | at <- ats - , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ] - + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 390 - | null instances = emptyTable - | otherwise - = s8 > instHdr instId > + | null instances = noHtml + | otherwise = vanillaTable << ( + instHdr instId > hunk ./src/Haddock/Backends/Xhtml/Decl.hs 397 + ) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 450 - (if summary then declBox else topDeclBox links loc docname) + (if summary then declElem else topDeclElem links loc docname) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 454 - doConstr c con = declBox (toHtml [c] <+> ppShortConstr summary (unLoc con) unicode) - doGADTConstr con = declBox (ppShortConstr summary (unLoc con) unicode) + doConstr c con = declElem (toHtml [c] <+> ppShortConstr summary (unLoc con) unicode) + doGADTConstr con = declElem (ppShortConstr summary (unLoc con) unicode) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 463 - SrcSpan -> Maybe (Doc DocName) -> TyClDecl DocName -> Bool -> HtmlTable + SrcSpan -> Maybe (Doc DocName) -> TyClDecl DocName -> Bool -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 470 - = (if validTable then (>) else const) header_ $ - tda [theclass "body"] << vanillaTable << ( - datadoc > - constrBit > - instancesBit - ) - + = header_ +++ datadoc +++ constrBit +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 477 - header_ = topDeclBox links loc docname (ppDataHeader summary dataDecl unicode + header_ = topDeclElem links loc docname (ppDataHeader summary dataDecl unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 513 - validTable = isJust mbDoc || not (null cons) || not (null instances) - hunk ./src/Haddock/Backends/Xhtml/Decl.hs 645 - where hdr = declBox (ppHsConstrHdr tvs ctxt +++ ppHsBinder False nm) + where hdr = declElem (ppHsConstrHdr tvs ctxt +++ ppHsBinder False nm) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 648 - | isJust doc = docBox (docToHtml (fromJust doc)) + | isJust doc = docElem (docToHtml (fromJust doc)) hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 83 - +maybeDocToHtml :: Maybe (Doc DocName) -> Html +maybeDocToHtml = maybe noHtml docToHtml hunk ./src/Haddock/Backends/Xhtml/Layout.hs 27 -declWithDoc :: Bool -> LinksInfo -> SrcSpan -> DocName -> Maybe (Doc DocName) -> Html -> HtmlTable -declWithDoc True _ _ _ _ html_decl = declBox html_decl -declWithDoc False links loc nm Nothing html_decl = topDeclBox links loc nm html_decl -declWithDoc False links loc nm (Just doc) html_decl = - topDeclBox links loc nm html_decl > docBox (docToHtml doc) - +declWithDoc :: Bool -> LinksInfo -> SrcSpan -> DocName -> Maybe (Doc DocName) -> Html -> Html +declWithDoc True _ _ _ _ html_decl = declElem html_decl +declWithDoc False links loc nm doc html_decl = + topDeclElem links loc nm html_decl +++ maybeDocToHtml doc hunk ./src/Haddock/Backends/Xhtml/Layout.hs 39 -declBox :: Html -> HtmlTable -declBox html = tda [theclass "decl"] << html +declElem :: Html -> Html +declElem = paragraph ! [theclass "decl"] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 44 -topDeclBox :: LinksInfo -> SrcSpan -> DocName -> Html -> HtmlTable -topDeclBox ((_,_,Nothing), (_,_,Nothing)) _ _ html = declBox html -topDeclBox ((_,_,maybe_source_url), (_,_,maybe_wiki_url)) - loc name html = - tda [theclass "topdecl"] << - ( table ! [theclass "declbar"] << - ((tda [theclass "declname"] << html) - <-> srcLink - <-> wikiLink) - ) +topDeclElem :: LinksInfo -> SrcSpan -> DocName -> Html -> Html +topDeclElem ((_,_,maybe_source_url), (_,_,maybe_wiki_url)) loc name html = + declElem << (html +++ srcLink +++ wikiLink) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 49 - Nothing -> emptyTable - Just url -> tda [theclass "declbut"] << - let url' = spliceURL (Just fname) (Just origMod) + Nothing -> noHtml + Just url -> let url' = spliceURL (Just fname) (Just origMod) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 52 - in anchor ! [href url'] << toHtml "Source" + in anchor ! [href url', theclass "link"] << "Source" hunk ./src/Haddock/Backends/Xhtml/Layout.hs 56 - Nothing -> emptyTable - Just url -> tda [theclass "declbut"] << - let url' = spliceURL (Just fname) (Just mdl) + Nothing -> noHtml + Just url -> let url' = spliceURL (Just fname) (Just mdl) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 59 - in anchor ! [href url'] << toHtml "Comments" + in anchor ! [href url', theclass "link"] << "Comments" hunk ./src/Haddock/Backends/Xhtml/Layout.hs 73 + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 80 --- a box for displaying documentation, --- indented and with a little padding at the top -docBox :: Html -> HtmlTable -docBox html = tda [theclass "doc"] << html hunk ./src/Haddock/Backends/Xhtml.hs 43 -import Data.Either hunk ./src/Haddock/Backends/Xhtml.hs 630 - rights $ - map (processExport True linksInfo unicode) exports + mapMaybe (processExport True linksInfo unicode) exports hunk ./src/Haddock/Backends/Xhtml.hs 643 - map (either id (paragraph ! [theclass "decl"] <<)) $ - map (processExport False linksInfo unicode) exports + map (thediv ! [theclass "decldoc"]) $ + mapMaybe (processExport False linksInfo unicode) exports hunk ./src/Haddock/Backends/Xhtml.hs 732 -processExport :: Bool -> LinksInfo -> Bool -> (ExportItem DocName) - -> Either Html Html -- Right is a decl, Left is a "extra" (doc or group) -processExport _ _ _ (ExportGroup lev id0 doc) - = Left $ groupTag lev << namedAnchor id0 << docToHtml doc +processExport :: Bool -> LinksInfo -> Bool -> (ExportItem DocName) -> Maybe Html +processExport summary _ _ (ExportGroup lev id0 doc) + = nothingIf summary $ groupTag lev << namedAnchor id0 << docToHtml doc hunk ./src/Haddock/Backends/Xhtml.hs 736 - = Right $ ppDecl summary links decl doc insts subdocs unicode + = Just $ ppDecl summary links decl doc insts subdocs unicode hunk ./src/Haddock/Backends/Xhtml.hs 738 - = Right $ ppDocName y + = Just $ ppDocName y hunk ./src/Haddock/Backends/Xhtml.hs 740 - = Right $ ppDocName y +++ parenList (map ppDocName subs) -processExport _ _ _ (ExportDoc doc) - = Left $ docToHtml doc + = Just $ ppDocName y +++ parenList (map ppDocName subs) +processExport summary _ _ (ExportDoc doc) + = nothingIf summary $ docToHtml doc hunk ./src/Haddock/Backends/Xhtml.hs 744 - = Right $ toHtml "module" +++ ppModule mdl "" + = Just $ toHtml "module" +++ ppModule mdl "" + +nothingIf :: Bool -> a -> Maybe a +nothingIf True _ = Nothing +nothingIf False a = Just a hunk ./src/Haddock/Backends/Xhtml/Decl.hs 436 - | otherwise = vanillaTable << ( + | otherwise = foldl (+++) dataHeader $ hunk ./src/Haddock/Backends/Xhtml/Decl.hs 438 - ResTyH98 -> dataHeader > - tda [theclass "body"] << vanillaTable << ( - aboves (zipWith doConstr ('=':repeat '|') cons) - ) - ResTyGADT _ -> dataHeader > - tda [theclass "body"] << vanillaTable << ( - aboves (map doGADTConstr cons) - ) - ) + ResTyH98 -> zipWith doConstr ('=':repeat '|') cons + ResTyGADT _ -> map doGADTConstr cons hunk ./src/Haddock/Backends/Xhtml/Decl.hs 624 -{- -ppHsFullConstr :: HsConDecl -> Html -ppHsFullConstr (HsConDecl _ nm tvs ctxt typeList doc) = - declWithDoc False doc ( - hsep ((ppHsConstrHdr tvs ctxt +++ - ppHsBinder False nm) : map ppHsBangType typeList) - ) -ppHsFullConstr (HsRecDecl _ nm tvs ctxt fields doc) = - td << vanillaTable << ( - case doc of - Nothing -> aboves [hdr, fields_html] - Just _ -> aboves [hdr, constr_doc, fields_html] - ) - - where hdr = declElem (ppHsConstrHdr tvs ctxt +++ ppHsBinder False nm) - - constr_doc - | isJust doc = docElem (docToHtml (fromJust doc)) - | otherwise = emptyTable - - fields_html = - td << - table ! [width "100%", cellpadding 0, cellspacing 8] << ( - aboves (map ppFullField (concat (map expandField fields))) - ) --} hunk ./src/Haddock/Backends/Xhtml/Decl.hs 632 -{- -ppFullField :: HsFieldDecl -> Html -ppFullField (HsFieldDecl [n] ty doc) - = declWithDoc False doc ( - ppHsBinder False n <+> dcolon <+> ppHsBangType ty - ) -ppFullField _ = error "ppFullField" - -expandField :: HsFieldDecl -> [HsFieldDecl] -expandField (HsFieldDecl ns ty doc) = [ HsFieldDecl [n] ty doc | n <- ns ] --} hunk ./src/Haddock/Backends/Xhtml/Decl.hs 655 -{- -ppForAll Implicit _ lctxt = ppCtxtPart lctxt -ppForAll Explicit ltvs lctxt = - hsep (keyword "forall" : ppTyVars ltvs ++ [dot]) <+> ppCtxtPart lctxt --} - - hunk ./src/Haddock/Backends/Xhtml/Decl.hs 664 -{- -ppType :: HsType DocName -> Html -ppType t = case t of - t@(HsForAllTy expl ltvs lcontext ltype) -> ppForAllTy t <+> ppLType ltype - HsTyVar n -> ppDocName n - HsBangTy HsStrict lt -> toHtml "!" <+> ppLType lt - HsBangTy HsUnbox lt -> toHtml "!!" <+> ppLType lt - HsAppTy a b -> ppLType a <+> ppLType b - HsFunTy a b -> hsep [ppLType a, toHtml "->", ppLType b] - HsListTy t -> brackets $ ppLType t - HsPArrTy t -> toHtml "[:" +++ ppLType t +++ toHtml ":]" - HsTupleTy Boxed ts -> parenList $ map ppLType ts - HsTupleTy Unboxed ts -> ubxParenList $ map ppLType ts - HsOpTy a n b -> ppLType a <+> ppLDocName n <+> ppLType b - HsParTy t -> parens $ ppLType t - HsNumTy n -> toHtml (show n) - HsPredTy p -> ppPred p - HsKindSig t k -> hsep [ppLType t, dcolon, ppKind k] - HsSpliceTy _ -> error "ppType" - HsDocTy t _ -> ppLType t --} hunk ./src/Haddock/Backends/Xhtml/Decl.hs 63 - | summary || Map.null argDocs = declWithDoc summary links loc docname doc pref1 + | summary = declElem pref1 + | Map.null argDocs = topDeclElem links loc docname pref1 +++ maybeDocToHtml doc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 166 - | summary = declWithDoc summary links loc docname mbDoc - (ppTyFamHeader True associated decl unicode) + | summary = declElem (ppTyFamHeader True associated decl unicode) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 218 - | summary = declWithDoc summary links loc docname mbDoc - (ppTyInstHeader True associated decl unicode) + | summary = declElem(ppTyInstHeader True associated decl unicode) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 427 -ppShortDataDecl summary links loc dataDecl unicode +ppShortDataDecl summary _links _loc dataDecl unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 429 - | [lcon] <- cons, ResTyH98 <- resTy = - ppDataHeader summary dataDecl unicode - <+> equals <+> ppShortConstr summary (unLoc lcon) unicode + | [] <- cons = declElem dataHeader hunk ./src/Haddock/Backends/Xhtml/Decl.hs 431 - | [] <- cons = ppDataHeader summary dataDecl unicode + | [lcon] <- cons, ResTyH98 <- resTy = declElem $ + dataHeader <+> equals <+> ppShortConstr summary (unLoc lcon) unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 434 - | otherwise = foldl (+++) dataHeader $ - case resTy of - ResTyH98 -> zipWith doConstr ('=':repeat '|') cons - ResTyGADT _ -> map doGADTConstr cons - - where - dataHeader = - (if summary then declElem else topDeclElem links loc docname) - ((ppDataHeader summary dataDecl unicode) <+> - case resTy of ResTyGADT _ -> keyword "where"; _ -> empty) + | ResTyH98 <- resTy = declElem dataHeader + +++ unordList (zipWith doConstr ('=':repeat '|') cons) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 437 + | otherwise = declElem (dataHeader <+> keyword "where") + +++ unordList (map doGADTConstr cons) + + where + dataHeader = ppDataHeader summary dataDecl unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 445 - docname = unLoc . tcdLName $ dataDecl hunk ./src/Haddock/Backends/Xhtml/Decl.hs 453 - | summary = declWithDoc summary links loc docname mbDoc - (ppShortDataDecl summary links loc dataDecl unicode) - - | otherwise - = header_ +++ datadoc +++ constrBit +++ instancesBit + | summary = ppShortDataDecl summary links loc dataDecl unicode + | otherwise = header_ +++ datadoc +++ constrBit +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Layout.hs 27 -declWithDoc :: Bool -> LinksInfo -> SrcSpan -> DocName -> Maybe (Doc DocName) -> Html -> Html -declWithDoc True _ _ _ _ html_decl = declElem html_decl -declWithDoc False links loc nm doc html_decl = - topDeclElem links loc nm html_decl +++ maybeDocToHtml doc - - -{- -text :: Html -text = strAttr "TEXT" --} - hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 44 - markupURL = \url -> anchor ! [href url] << toHtml url, - markupAName = \aname -> namedAnchor aname << toHtml "" + markupURL = \url -> anchor ! [href url] << url, + markupAName = \aname -> namedAnchor aname << "", + markupPic = \path -> image ! [src path], + markupExample = examplesToHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 431 - | [lcon] <- cons, ResTyH98 <- resTy = declElem $ - dataHeader <+> equals <+> ppShortConstr summary (unLoc lcon) unicode + | [lcon] <- cons, ResTyH98 <- resTy = declElem (dataHeader <+> equals) + <+> ppShortConstr summary (unLoc lcon) unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 442 - doConstr c con = declElem (toHtml [c] <+> ppShortConstr summary (unLoc con) unicode) - doGADTConstr con = declElem (ppShortConstr summary (unLoc con) unicode) + doConstr c con = toHtml [c] <+> ppShortConstr summary (unLoc con) unicode + doGADTConstr con = ppShortConstr summary (unLoc con) unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 528 - doRecordFields fields = braces (vanillaTable << - aboves (map (ppShortField summary unicode) fields)) + doRecordFields fields = braces $ unordList (map (ppShortField summary unicode) fields) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 615 -ppShortField :: Bool -> Bool -> ConDeclField DocName -> HtmlTable +ppShortField :: Bool -> Bool -> ConDeclField DocName -> Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 617 - = tda [theclass "recfield"] << ( - ppBinder summary (docNameOcc name) - <+> dcolon unicode <+> ppLType unicode ltype - ) + = ppBinder summary (docNameOcc name) + <+> dcolon unicode <+> ppLType unicode ltype hunk ./src/Haddock/Backends/Xhtml/Decl.hs 178 - | otherwise = vanillaTable << ( - instHdr instId > - tda [theclass "body"] << - collapsed thediv instId ( - spacedTable1 << ( - aboves (map (ppDocInstance unicode) instances) - ) + | otherwise = + instHdr instId +++ + collapsed thediv instId ( + spacedTable1 << ( + aboves (map (ppDocInstance unicode) instances) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 388 - | otherwise = vanillaTable << ( - instHdr instId > - tda [theclass "body"] << - collapsed thediv instId ( - spacedTable1 << aboves (map (ppDocInstance unicode) instances) - ) - ) + | otherwise = + instHdr instId +++ + collapsed thediv instId ( + spacedTable1 << aboves (map (ppDocInstance unicode) instances) + ) + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 451 - | otherwise = header_ +++ datadoc +++ constrBit +++ instancesBit + | otherwise = header_ +++ maybeDocToHtml mbDoc +++ constrBit +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 471 - datadoc = case mbDoc of - Just doc -> ndocBox (docToHtml doc) - Nothing -> emptyTable - hunk ./src/Haddock/Backends/Xhtml/Decl.hs 472 - | null cons = emptyTable - | otherwise = constrHdr > ( - tda [theclass "body"] << constrTable << + | null cons = noHtml + | otherwise = constrHdr +++ ( + constrTable << hunk ./src/Haddock/Backends/Xhtml/Decl.hs 481 - | null instances = emptyTable + | null instances = noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 483 - = instHdr instId > - tda [theclass "body"] << + = instHdr instId +++ hunk ./src/Haddock/Backends/Xhtml/Layout.hs 95 -constrHdr, methHdr, atHdr :: HtmlTable -constrHdr = tda [ theclass "section4" ] << toHtml "Constructors" -methHdr = tda [ theclass "section4" ] << toHtml "Methods" -atHdr = tda [ theclass "section4" ] << toHtml "Associated Types" +constrHdr, methHdr, atHdr :: Html +constrHdr = h5 << "Constructors" +methHdr = h5 << "Methods" +atHdr = h5 << "Associated Types" hunk ./src/Haddock/Backends/Xhtml/Layout.hs 100 -instHdr :: String -> HtmlTable +instHdr :: String -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 102 - tda [ theclass "section4" ] << (collapsebutton id_ +++ toHtml " Instances") + h5 << (collapsebutton id_ +++ toHtml " Instances") hunk ./src/Haddock/Backends/Xhtml/Decl.hs 350 - +++ vanillaTable << - ( - bodyBox << aboves + +++ vanillaTable << aboves hunk ./src/Haddock/Backends/Xhtml/Decl.hs 352 - [ ppAssocType summary links doc at unicode | at <- ats + [ argBox $ ppAssocType summary links doc at unicode | at <- ats hunk ./src/Haddock/Backends/Xhtml/Decl.hs 355 - [ ppFunSig summary links loc doc n typ unicode + [ argBox $ ppFunSig summary links loc doc n typ unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 359 - ) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 83 -bodyBox :: Html -> HtmlTable -bodyBox html = tda [theclass "body"] << vanillaTable << html - hunk ./src/Haddock/Backends/Xhtml.hs 569 - -- XXX: quoting errors possible? - << ("window.onload = function () {setSynopsis(\"mini_" - ++ moduleHtmlFile mdl ++ "\")};")) + -- NB: Within XHTML, the content of script tags needs to be + -- a CDATA section. Will break if the generated name could + -- have "]]>" in it! + << primHtml ( + "//\n") + ) hunk ./html/xhaddock.css 41 -h4 { +h4, h5 { hunk ./html/xhaddock.css 65 -h1 + p, h2 + p, h3 + p, h4 + p { +h2 + p, h3 + p, h4 + p { hunk ./html/xhaddock.css 155 - margin-top: 1em; - margin-bottom: 1em; - margin-left: 10px; + margin-left: 0px; hunk ./html/xhaddock.css 167 +ul.synopsis li ul { + margin: 0; + padding-top: 0; +} + +ul.synopsis li ul li { + margin: 0; + padding: 0; +} + + +div.decldoc { + margin-top: 1em; +} + +div.decldoc h5 { + margin-left: 10px; +} + +div.decldoc table { + margin-left: 20px; +} hunk ./html/xhaddock.css 242 +td.arg { + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; + margin-bottom: 0; +} + +td.rdoc p { + margin-bottom: 0; +} + hunk ./html/xhaddock.css 258 - padding: 5px + padding: 4px hunk ./html/xhaddock.css 260 + +div.bottom p { + margin-bottom: 0; +} + hunk ./html/xhaddock.css 186 -div.decldoc table { +div.decldoc table, div.subdecl { hunk ./src/Haddock/Backends/Xhtml/Decl.hs 370 - decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ _ _) unicode + decl@(ClassDecl lctxt lname ltyvars lfds lsigs _ ats _) unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 372 - | otherwise = classheader +++ maybeDocToHtml mbDoc +++ instancesBit + | otherwise = classheader +++ maybeDocToHtml mbDoc + +++ atBit +++ methodBit +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 382 - + + atBit + | null ats = noHtml + | otherwise = atHdr +++ ( + thediv ! [theclass "subdecl"] << + concatHtml [ ppAssocType summary links doc at unicode + | at <- ats + , let doc = lookupAnySubdoc (tcdName $ unL at) subdocs ] + ) + + methodBit + | null lsigs = noHtml + | otherwise = methHdr +++ ( + thediv ! [theclass "subdecl"] << + concatHtml [ ppFunSig summary links loc doc n typ unicode + | L _ (TypeSig (L _ n) (L _ typ)) <- lsigs + , let doc = lookupAnySubdoc n subdocs ] + ) + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 13 - -module Haddock.Backends.Xhtml.Decl where +module Haddock.Backends.Xhtml.Decl ( + ppDecl, + + ppTyName, ppTyFamHeader, ppTypeApp, + tyvarNames +) where hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 13 - -module Haddock.Backends.Xhtml.DocMarkup where +module Haddock.Backends.Xhtml.DocMarkup ( + docToHtml, maybeDocToHtml, + rdrDocToHtml, + origDocToHtml +) where hunk ./src/Haddock/Backends/Xhtml/Layout.hs 13 - -module Haddock.Backends.Xhtml.Layout where +module Haddock.Backends.Xhtml.Layout ( + topDeclElem, declElem, + + instHdr, atHdr, methHdr, constrHdr, + argBox, ndocBox, rdocBox, maybeRDocBox, + + vanillaTable, vanillaTable2, spacedTable1, spacedTable5 +) where hunk ./src/Haddock/Backends/Xhtml/Names.hs 13 - -module Haddock.Backends.Xhtml.Names where +module Haddock.Backends.Xhtml.Names ( + ppName, ppDocName, ppLDocName, ppRdrName, + ppBinder, ppBinder', + ppModule, + linkId +) where hunk ./src/Haddock/Backends/Xhtml/Types.hs 13 - -module Haddock.Backends.Xhtml.Types where +module Haddock.Backends.Xhtml.Types ( + SourceURLs, WikiURLs, + LinksInfo +) where hunk ./src/Haddock/Backends/Xhtml/Util.hs 13 - -module Haddock.Backends.Xhtml.Util where +module Haddock.Backends.Xhtml.Util ( + renderToString, + + namedAnchor, linkedAnchor, + spliceURL, + + (<+>), (<++>), char, empty, + keyword, punctuate, + + braces, brackets, pabrackets, parens, parenList, ubxParenList, + arrow, comma, dcolon, dot, darrow, equals, forallSymbol, quote, + + tda, emptyTable, s8, + abovesSep, hsep, + + collapsebutton, collapseId, collapsed, + documentCharacterEncoding, styleSheet +) where hunk ./html/xhaddock.css 157 + +ul.synopsis p.decl { + padding: 0; +} hunk ./html/xhaddock.css 165 - margin-top: 8px; - margin-bottom: 8px; - padding: 2px; + margin-top: 6px; + margin-bottom: 6px; + padding: 3px; hunk ./html/xhaddock.css 177 - margin: 0; + margin: 3px; hunk ./html/xhaddock.css 266 - margin-bottom: 0; + padding: 1px; + margin: 0; hunk ./src/Haddock/Backends/Xhtml.hs 748 - = Just $ toHtml "module" +++ ppModule mdl "" + = Just $ toHtml "module" <+> ppModule mdl "" hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 38 - markupIdentifier = tt . ppId . choose, + markupIdentifier = thecode . ppId . choose, hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 42 - markupMonospaced = tt, + markupMonospaced = thecode, hunk ./src/Haddock/Backends/Xhtml/Decl.hs 178 - instId = collapseId (getName docname) - - instancesBit - | associated || null instances = noHtml - | otherwise = - instHdr instId +++ - collapsed thediv instId ( - spacedTable1 << ( - aboves (map (ppDocInstance unicode) instances) - ) - ) + instancesBit = ppInstances instances docname unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 395 - instId = collapseId (getName nm) - instancesBit - | null instances = noHtml - | otherwise = - instHdr instId +++ - collapsed thediv instId ( - spacedTable1 << aboves (map (ppDocInstance unicode) instances) - ) - + instancesBit = ppInstances instances nm unicode + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 400 + +ppInstances :: [DocInstance DocName] -> DocName -> Bool -> Html +ppInstances instances baseName unicode + | null instances = noHtml + | otherwise = + instHdr instId +++ + collapsed thediv instId ( + spacedTable1 << aboves (map (ppDocInstance unicode) instances) + ) + where + instId = collapseId (getName baseName) + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 493 - instId = collapseId (getName docname) - - instancesBit - | null instances = noHtml - | otherwise - = instHdr instId +++ - collapsed thediv instId ( - spacedTable1 << aboves (map (ppDocInstance unicode) instances - ) - ) + instancesBit = ppInstances instances docname unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 443 - | [lcon] <- cons, ResTyH98 <- resTy = declElem (dataHeader <+> equals) - <+> ppShortConstr summary (unLoc lcon) unicode + | [lcon] <- cons, ResTyH98 <- resTy, + (cHead,cBody,cFoot) <- ppShortConstrParts summary (unLoc lcon) unicode + = declElem (dataHeader <+> equals <+> cHead) +++ cBody +++ cFoot hunk ./src/Haddock/Backends/Xhtml/Decl.hs 459 - resTy = (con_res . unLoc . head) cons + resTy = (con_res . unLoc . head) cons hunk ./src/Haddock/Backends/Xhtml/Decl.hs 503 + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 505 -ppShortConstr summary con unicode = case con_res con of +ppShortConstr summary con unicode = cHead <+> cBody <+> cFoot + where + (cHead,cBody,cFoot) = ppShortConstrParts summary con unicode + + +-- returns three pieces: header, body, footer so that header & footer can be +-- incorporated into the declaration +ppShortConstrParts :: Bool -> ConDecl DocName -> Bool -> (Html, Html, Html) +ppShortConstrParts summary con unicode = case con_res con of hunk ./src/Haddock/Backends/Xhtml/Decl.hs 515 - PrefixCon args -> header_ unicode +++ hsep (ppBinder summary occ : map (ppLParendType unicode) args) - RecCon fields -> header_ unicode +++ ppBinder summary occ <+> - doRecordFields fields - InfixCon arg1 arg2 -> header_ unicode +++ - hsep [ppLParendType unicode arg1, ppBinder summary occ, ppLParendType unicode arg2] + PrefixCon args -> + (header_ unicode +++ hsep (ppBinder summary occ : map (ppLParendType unicode) args), + noHtml, noHtml) + RecCon fields -> + (header_ unicode +++ ppBinder summary occ <+> char '{', + doRecordFields fields, + char '}') + InfixCon arg1 arg2 -> + (header_ unicode +++ hsep [ppLParendType unicode arg1, ppBinder summary occ, ppLParendType unicode arg2], + noHtml, noHtml) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 529 - PrefixCon args -> doGADTCon args resTy + PrefixCon args -> (doGADTCon args resTy, noHtml, noHtml) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 534 - RecCon fields -> ppBinder summary occ <+> dcolon unicode <+> hsep [ - ppForAll forall ltvs lcontext unicode, + RecCon fields -> (ppBinder summary occ <+> dcolon unicode <+> + ppForAll forall ltvs lcontext unicode <+> char '{', hunk ./src/Haddock/Backends/Xhtml/Decl.hs 537 - arrow unicode <+> ppLType unicode resTy ] - InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy + char '}' <+> arrow unicode <+> ppLType unicode resTy) + InfixCon arg1 arg2 -> (doGADTCon [arg1, arg2] resTy, noHtml, noHtml) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 541 - doRecordFields fields = braces $ unordList (map (ppShortField summary unicode) fields) + doRecordFields fields = unordList (map (ppShortField summary unicode) fields) hunk ./src/Haddock/Backends/Xhtml.hs 665 - | Nothing <- ps -> keyword "data" <++> ppTyClBinderWithVarsMini mdl d - | Just _ <- ps -> keyword "data" <++> keyword "instance" - <++> ppTyClBinderWithVarsMini mdl d + | Nothing <- ps -> keyword "data" <+> ppTyClBinderWithVarsMini mdl d + | Just _ <- ps -> keyword "data" <+> keyword "instance" + <+> ppTyClBinderWithVarsMini mdl d hunk ./src/Haddock/Backends/Xhtml.hs 669 - | Nothing <- ps -> keyword "type" <++> ppTyClBinderWithVarsMini mdl d - | Just _ <- ps -> keyword "type" <++> keyword "instance" - <++> ppTyClBinderWithVarsMini mdl d + | Nothing <- ps -> keyword "type" <+> ppTyClBinderWithVarsMini mdl d + | Just _ <- ps -> keyword "type" <+> keyword "instance" + <+> ppTyClBinderWithVarsMini mdl d hunk ./src/Haddock/Backends/Xhtml.hs 673 - keyword "class" <++> ppTyClBinderWithVarsMini mdl d + keyword "class" <+> ppTyClBinderWithVarsMini mdl d hunk ./src/Haddock/Backends/Xhtml/Util.hs 19 - (<+>), (<++>), char, empty, + (<+>), char, empty, hunk ./src/Haddock/Backends/Xhtml/Util.hs 96 -infixr 8 <+>, <++> +infixr 8 <+> hunk ./src/Haddock/Backends/Xhtml/Util.hs 100 -(<++>) :: Html -> Html -> Html -a <++> b = a +++ spaceHtml +++ b - hunk ./html/xhaddock.css 21 -span.keyword { text-decoration: underline; } +.keyword { text-decoration: underline; } +.caption { + font-weight: bold; + margin: 0; + padding: 0; +} hunk ./html/xhaddock.css 31 - font-size: 150% - } + font-size: 150%; +} hunk ./html/xhaddock.css 51 +h1, h2, h3, h4, h5 { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + hunk ./html/xhaddock.css 79 -p.caption { - margin: 0; - padding: 0; -} hunk ./html/xhaddock.css 80 -div.package-header { +#package-header { hunk ./html/xhaddock.css 88 -div.package-header a:link { color: #ffffff } -div.package-header a:visited { color: #ffff00 } -div.package-header a:hover { background-color: #6060ff; } -div.package-header ul.links li:hover { background-color: #6060ff; } +#package-header a:link { color: #ffffff } +#package-header a:visited { color: #ffff00 } +#package-header a:hover { background-color: #6060ff; } +#package-header ul.links li:hover { background-color: #6060ff; } hunk ./html/xhaddock.css 111 -div.module-header { +#module-header { hunk ./html/xhaddock.css 115 - height: 3em; hunk ./html/xhaddock.css 117 -div.module-header p { +#module-header .caption { hunk ./html/xhaddock.css 121 + font-weight: normal; + font-style: normal; hunk ./html/xhaddock.css 145 -div.table-of-contents { +#table-of-contents { hunk ./html/xhaddock.css 147 - margin-bottom: 1em; + margin-bottom: 2em; hunk ./html/xhaddock.css 150 -div.table-of-contents p { - font-weight: bold; -} - -div.table-of-contents ul { +#table-of-contents ul { hunk ./html/xhaddock.css 153 - margin-left: 10px; + margin-left: 0; hunk ./html/xhaddock.css 155 + padding: 0; +} + +#table-of-contents ul ul { + margin-left: 2.5em; +} + +#description .caption, +#synopsis .caption { + padding-top: 15px; + font-weight: bold; + font-size: 150% hunk ./html/xhaddock.css 169 -ul.synopsis { - margin-left: 0px; +#synopsis { + margin-bottom: 2em; hunk ./html/xhaddock.css 173 -ul.synopsis p.decl { +#synopsis p.src { hunk ./html/xhaddock.css 176 -ul.synopsis li { +#synopsis li { hunk ./html/xhaddock.css 180 - margin-top: 6px; - margin-bottom: 6px; + margin-top: 8px; + margin-bottom: 8px; hunk ./html/xhaddock.css 186 -ul.synopsis li ul { +#synopsis ul { hunk ./html/xhaddock.css 191 -ul.synopsis li ul li { +#synopsis li ul li { hunk ./html/xhaddock.css 197 -div.decldoc { +div.top { hunk ./html/xhaddock.css 201 -div.decldoc h5 { +div.top h5 { hunk ./html/xhaddock.css 205 -div.decldoc table, div.subdecl { +div.top table, div.subdecl { hunk ./html/xhaddock.css 209 -p.decl { +.src { hunk ./html/xhaddock.css 217 -p.decl a.link { +.src a.link { hunk ./html/xhaddock.css 274 -div.bottom { +#footer { hunk ./html/xhaddock.css 280 -div.bottom p { +#footer p { hunk ./html/xhaddock.css 285 -div.bottom a:link { +#footer a:link { hunk ./html/xhaddock.css 289 -div.bottom a:visited { +#footer a:visited { hunk ./html/xhaddock.css 292 -div.bottom a:hover { +#footer a:hover { hunk ./src/Haddock/Backends/Xhtml.hs 155 - thediv ! [theclass "bottom"] << paragraph << ( + divFooter << paragraph << ( hunk ./src/Haddock/Backends/Xhtml.hs 197 - thediv ! [theclass "package-header"] << ( - paragraph ! [theclass "caption"] << doctitle +++ + divPackageHeader << ( + sectionName << nonEmpty doctitle +++ hunk ./src/Haddock/Backends/Xhtml.hs 213 - thediv ! [theclass "package-header"] << ( - paragraph ! [theclass "caption"] << (doctitle +++ spaceHtml) +++ + divPackageHeader << ( + sectionName << nonEmpty doctitle +++ hunk ./src/Haddock/Backends/Xhtml.hs 222 - thediv ! [theclass "module-header"] << ( - paragraph ! [theclass "caption"] << mdl +++ + divModuleHeader << ( + sectionName << mdl +++ hunk ./src/Haddock/Backends/Xhtml.hs 609 - maybe_doc_hdr +++ - bdy + divInterface (maybe_doc_hdr +++ bdy) hunk ./src/Haddock/Backends/Xhtml.hs 625 - Just doc -> h1 << toHtml "Description" +++ docToHtml doc + Just doc -> divDescription $ + sectionName << "Description" +++ docToHtml doc hunk ./src/Haddock/Backends/Xhtml.hs 632 - = h1 << "Synopsis" +++ - unordList ( - mapMaybe (processExport True linksInfo unicode) exports - ) ! [theclass "synopsis"] + = divSynposis $ + sectionName << "Synopsis" +++ + shortDeclList ( + mapMaybe (processExport True linksInfo unicode) exports + ) hunk ./src/Haddock/Backends/Xhtml.hs 648 - map (thediv ! [theclass "decldoc"]) $ - mapMaybe (processExport False linksInfo unicode) exports + mapMaybe (processExport False linksInfo unicode) exports hunk ./src/Haddock/Backends/Xhtml.hs 705 - contentsDiv = thediv ! [theclass "table-of-contents"] << ( - paragraph ! [theclass "caption"] << "Contents" +++ + contentsDiv = divTableOfContents << ( + sectionName << "Contents" +++ hunk ./src/Haddock/Backends/Xhtml.hs 740 - = Just $ ppDecl summary links decl doc insts subdocs unicode -processExport _ _ _ (ExportNoDecl y []) - = Just $ ppDocName y -processExport _ _ _ (ExportNoDecl y subs) - = Just $ ppDocName y +++ parenList (map ppDocName subs) + = processDecl summary $ ppDecl summary links decl doc insts subdocs unicode +processExport summary _ _ (ExportNoDecl y []) + = processDeclOneLiner summary $ ppDocName y +processExport summary _ _ (ExportNoDecl y subs) + = processDeclOneLiner summary $ ppDocName y +++ parenList (map ppDocName subs) hunk ./src/Haddock/Backends/Xhtml.hs 747 -processExport _ _ _ (ExportModule mdl) - = Just $ toHtml "module" <+> ppModule mdl "" +processExport summary _ _ (ExportModule mdl) + = processDeclOneLiner summary $ toHtml "module" <+> ppModule mdl "" hunk ./src/Haddock/Backends/Xhtml.hs 754 +processDecl :: Bool -> Html -> Maybe Html +processDecl True = Just +processDecl False = Just . divTopDecl + +processDeclOneLiner :: Bool -> Html -> Maybe Html +processDeclOneLiner True = Just +processDeclOneLiner False = Just . divTopDecl . declElem + hunk ./src/Haddock/Backends/Xhtml.hs 771 - hunk ./src/Haddock/Backends/Xhtml/Layout.hs 14 + divPackageHeader, divModuleHeader, divFooter, + divTableOfContents, divDescription, divSynposis, divInterface, + + sectionName, + + shortDeclList, + divTopDecl, + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 40 +-- Sections of the document + +divPackageHeader, divModuleHeader, divFooter :: Html -> Html +divPackageHeader = thediv ! [identifier "package-header"] +divModuleHeader = thediv ! [identifier "module-header"] +divFooter = thediv ! [identifier "footer"] + +divTableOfContents, divDescription, divSynposis, divInterface :: Html -> Html +divTableOfContents = thediv ! [identifier "table-of-contents"] +divDescription = thediv ! [identifier "description"] +divSynposis = thediv ! [identifier "synopsis"] +divInterface = thediv ! [identifier "interface"] + +-- | The name of a section, used directly after opening a section +sectionName :: Html -> Html +sectionName = paragraph ! [theclass "caption"] + + +-- | Declaration containers + +shortDeclList :: [Html] -> Html +shortDeclList items = ulist << map (li ! [theclass "src short"] <<) items + +divTopDecl :: Html -> Html +divTopDecl = thediv ! [theclass "top"] + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 69 -declElem = paragraph ! [theclass "decl"] +declElem = paragraph ! [theclass "src"] hunk ./src/Haddock/Backends/Xhtml/Util.hs 19 - (<+>), char, empty, + (<+>), char, empty, nonEmpty, hunk ./src/Haddock/Backends/Xhtml/Util.hs 113 +-- | ensure content contains at least something (a non-breaking space) +nonEmpty :: (HTML a) => a -> Html +nonEmpty a = if isNoHtml h then spaceHtml else h + where h = toHtml a + hunk ./html/xhaddock.css 3 - padding: 0; + padding: 0; hunk ./html/xhaddock.css 59 - margin-bottom: 1em; hunk ./html/xhaddock.css 65 - margin-bottom: 1em; hunk ./html/xhaddock.css 70 - margin-bottom: 1em; hunk ./html/xhaddock.css 72 -h2 + p, h3 + p, h4 + p { +* + p, * + pre { hunk ./html/xhaddock.css 75 +.caption + p, .src + p { + margin-top: 0; +} hunk ./html/xhaddock.css 199 + clear: left; + margin-bottom: 1em; hunk ./html/xhaddock.css 229 +div.subs { + margin-left: 10px; + clear: both; + margin-top: 2px; +} + +.subs dl { + margin-left: 0; +} + +.subs dl dl { + padding-left: 0; + padding-top: 4px; +} + +.subs dt { + float: left; + margin-right: 1em; + clear: left; +} + +.subs dd +{ + margin-bottom: 2px; + margin-top: 2px; +} + +.fields .caption { + display: none; +} + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 483 - constrTable - | any isRecCon cons = spacedTable5 - | otherwise = spacedTable1 - - constrBit - | null cons = noHtml - | otherwise = constrHdr +++ ( - constrTable << - aboves (map (ppSideBySideConstr subdocs unicode) cons) - ) + constrBit = subDecls "Constructors" + (map (ppSideBySideConstr subdocs unicode) cons) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 489 -isRecCon :: Located (ConDecl a) -> Bool -isRecCon lcon = case con_details (unLoc lcon) of - RecCon _ -> True - _ -> False - - hunk ./src/Haddock/Backends/Xhtml/Decl.hs 556 -ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LConDecl DocName -> HtmlTable +ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LConDecl DocName -> (Html, Maybe Html) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 562 - argBox (hsep ((header_ unicode +++ ppBinder False occ) : map (ppLParendType unicode) args)) - <-> maybeRDocBox mbDoc + (hsep ((header_ unicode +++ ppBinder False occ) + : map (ppLParendType unicode) args), + fmap docToHtml mbDoc) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 567 - argBox (header_ unicode +++ ppBinder False occ) <-> - maybeRDocBox mbDoc - > - doRecordFields fields + (header_ unicode +++ ppBinder False occ, + fmap docToHtml mbDoc `with` (Just $ doRecordFields fields)) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 571 - argBox (hsep [header_ unicode+++ppLParendType unicode arg1, ppBinder False occ, ppLParendType unicode arg2]) - <-> maybeRDocBox mbDoc + (hsep [header_ unicode+++ppLParendType unicode arg1, + ppBinder False occ, + ppLParendType unicode arg2], + fmap docToHtml mbDoc) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 579 - PrefixCon args -> doGADTCon args resTy + PrefixCon args -> doGADTCon args resTy Nothing hunk ./src/Haddock/Backends/Xhtml/Decl.hs 581 - > doRecordFields fields - InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy + (Just $ doRecordFields fields) + InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy Nothing hunk ./src/Haddock/Backends/Xhtml/Decl.hs 585 - doRecordFields fields = - (tda [theclass "body"] << spacedTable1 << - aboves (map (ppSideBySideField subdocs unicode) fields)) - doGADTCon args resTy = argBox (ppBinder False occ <+> dcolon unicode <+> hsep [ - ppForAll forall ltvs (con_cxt con) unicode, - ppLType unicode (foldr mkFunTy resTy args) ] - ) <-> maybeRDocBox mbDoc - + doRecordFields fields = subDecls "Fields" + (map (ppSideBySideField subdocs unicode) fields) + doGADTCon :: [LHsType DocName] -> Located (HsType DocName) -> Maybe Html -> (Html, Maybe Html) + doGADTCon args resTy fieldsHtml = + (ppBinder False occ <+> dcolon unicode + <+> hsep [ppForAll forall ltvs (con_cxt con) unicode, + ppLType unicode (foldr mkFunTy resTy args) ], + fmap docToHtml mbDoc `with` fieldsHtml) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 594 + with a = maybe a (\b -> Just $ a +++ b) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 607 -ppSideBySideField :: [(DocName, DocForDecl DocName)] -> Bool -> ConDeclField DocName -> HtmlTable +ppSideBySideField :: [(DocName, DocForDecl DocName)] -> Bool -> ConDeclField DocName -> (Html, Maybe Html) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 609 - argBox (ppBinder False (docNameOcc name) - <+> dcolon unicode <+> ppLType unicode ltype) <-> maybeRDocBox mbDoc + (ppBinder False (docNameOcc name) <+> dcolon unicode <+> ppLType unicode ltype, + fmap docToHtml mbDoc) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 20 - divTopDecl, + divTopDecl, + subDecls, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 25 - instHdr, atHdr, methHdr, constrHdr, + instHdr, atHdr, methHdr, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 36 +import Data.Char (isLetter, toLower) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 68 +subDecls :: String -> [(Html, Maybe Html)] -> Html +subDecls _ [] = noHtml +subDecls name decls = subSection << (subCaption +++ subList) + where + subSection = thediv ! [theclass $ unwords ["subs", subClass]] + subClass = map (\c -> if isLetter c then toLower c else '-') name + subCaption = paragraph ! [theclass "caption"] << name + subList = dlist << map subEntry decls + subEntry (dt,dd) = [dterm ! [theclass "src"] << dt, ddef << nonEmpty dd] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 143 -constrHdr, methHdr, atHdr :: Html -constrHdr = h5 << "Constructors" +methHdr, atHdr :: Html hunk ./src/Haddock/Backends/Xhtml/Decl.hs 483 - constrBit = subDecls "Constructors" + constrBit = subConstructors hunk ./src/Haddock/Backends/Xhtml/Decl.hs 556 -ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LConDecl DocName -> (Html, Maybe Html) -ppSideBySideConstr subdocs unicode (L _ con) = case con_res con of - - ResTyH98 -> case con_details con of - - PrefixCon args -> - (hsep ((header_ unicode +++ ppBinder False occ) - : map (ppLParendType unicode) args), - fmap docToHtml mbDoc) - - RecCon fields -> - (header_ unicode +++ ppBinder False occ, - fmap docToHtml mbDoc `with` (Just $ doRecordFields fields)) +ppSideBySideConstr :: [(DocName, DocForDecl DocName)] -> Bool -> LConDecl DocName -> SubDecl +ppSideBySideConstr subdocs unicode (L _ con) = (decl, mbDoc, fieldPart) + where + decl = case con_res con of + ResTyH98 -> case con_details con of + PrefixCon args -> + hsep ((header_ unicode +++ ppBinder False occ) + : map (ppLParendType unicode) args) + + RecCon _ -> header_ unicode +++ ppBinder False occ + + InfixCon arg1 arg2 -> + hsep [header_ unicode+++ppLParendType unicode arg1, + ppBinder False occ, + ppLParendType unicode arg2] + + ResTyGADT resTy -> case con_details con of + -- prefix & infix could also use hsConDeclArgTys if it seemed to + -- simplify the code. + PrefixCon args -> doGADTCon args resTy + cd@(RecCon _) -> doGADTCon (hsConDeclArgTys cd) resTy + InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy hunk ./src/Haddock/Backends/Xhtml/Decl.hs 579 - InfixCon arg1 arg2 -> - (hsep [header_ unicode+++ppLParendType unicode arg1, - ppBinder False occ, - ppLParendType unicode arg2], - fmap docToHtml mbDoc) - - ResTyGADT resTy -> case con_details con of - -- prefix & infix could also use hsConDeclArgTys if it seemed to - -- simplify the code. - PrefixCon args -> doGADTCon args resTy Nothing - cd@(RecCon fields) -> doGADTCon (hsConDeclArgTys cd) resTy - (Just $ doRecordFields fields) - InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy Nothing + fieldPart = case con_details con of + RecCon fields -> [doRecordFields fields] + _ -> [] hunk ./src/Haddock/Backends/Xhtml/Decl.hs 583 - where - doRecordFields fields = subDecls "Fields" + doRecordFields fields = subFields hunk ./src/Haddock/Backends/Xhtml/Decl.hs 585 - doGADTCon :: [LHsType DocName] -> Located (HsType DocName) -> Maybe Html -> (Html, Maybe Html) - doGADTCon args resTy fieldsHtml = - (ppBinder False occ <+> dcolon unicode + doGADTCon :: [LHsType DocName] -> Located (HsType DocName) -> Html + doGADTCon args resTy = + ppBinder False occ <+> dcolon unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 589 - ppLType unicode (foldr mkFunTy resTy args) ], - fmap docToHtml mbDoc `with` fieldsHtml) + ppLType unicode (foldr mkFunTy resTy args) ] hunk ./src/Haddock/Backends/Xhtml/Decl.hs 591 - with a = maybe a (\b -> Just $ a +++ b) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 603 -ppSideBySideField :: [(DocName, DocForDecl DocName)] -> Bool -> ConDeclField DocName -> (Html, Maybe Html) +ppSideBySideField :: [(DocName, DocForDecl DocName)] -> Bool -> ConDeclField DocName -> SubDecl hunk ./src/Haddock/Backends/Xhtml/Decl.hs 606 - fmap docToHtml mbDoc) + mbDoc, + []) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 21 - subDecls, + + SubDecl, + subConstructors, subFields, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 38 -import Data.Char (isLetter, toLower) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 69 -subDecls :: String -> [(Html, Maybe Html)] -> Html -subDecls _ [] = noHtml -subDecls name decls = subSection << (subCaption +++ subList) + +type SubDecl = (Html, Maybe (Doc DocName), [Html]) + +divSubDecls :: String -> String -> Maybe Html -> Html +divSubDecls cssClass captionName = maybe noHtml wrap + where + wrap = (subSection <<) . (subCaption +++) + subSection = thediv ! [theclass $ unwords ["subs", cssClass]] + subCaption = paragraph ! [theclass "caption"] << captionName + +subDlist :: [SubDecl] -> Maybe Html +subDlist [] = Nothing +subDlist decls = Just $ dlist << map subEntry decls hunk ./src/Haddock/Backends/Xhtml/Layout.hs 83 - subSection = thediv ! [theclass $ unwords ["subs", subClass]] - subClass = map (\c -> if isLetter c then toLower c else '-') name - subCaption = paragraph ! [theclass "caption"] << name - subList = dlist << map subEntry decls - subEntry (dt,dd) = [dterm ! [theclass "src"] << dt, ddef << nonEmpty dd] + subEntry (decl, mdoc, subs) = Just $ + dterm ! [theclass "src"] << decl + +++ ddef << (fmap docToHtml mdoc `with` subs) + Nothing `with` [] = spaceHtml + ma `with` bs = ma +++ bs + +subConstructors :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subConstructors = divSubDecls "constructors" "Constructors" . subDlist + +subFields :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subFields = divSubDecls "fields" "Fields" . subDlist + hunk ./html/xhaddock.css 207 -div.top table, div.subdecl { - margin-left: 20px; -} hunk ./html/xhaddock.css 253 +.subs table { + margin-left: 10px; + border-spacing: 1px 1px; + margin-top: 4px; + margin-bottom: 4px; +} + +.subs table table { + margin-left: 0; +} + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 83 - subEntry (decl, mdoc, subs) = Just $ + subEntry (decl, mdoc, subs) = hunk ./src/Haddock/Backends/Xhtml/Layout.hs 85 - +++ ddef << (fmap docToHtml mdoc `with` subs) + +++ + ddef << (fmap docToHtml mdoc `with` subs) + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 91 +subTable :: [SubDecl] -> Maybe Html +subTable [] = Nothing +subTable decls = Just $ table << aboves (concatMap subRow decls) + where + subRow (decl, mdoc, subs) = + (td ! [theclass "src"] << decl + <-> + td << nonEmpty (fmap docToHtml mdoc)) + : map (cell . (td <<)) subs + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 102 -subConstructors = divSubDecls "constructors" "Constructors" . subDlist +subConstructors = divSubDecls "constructors" "Constructors" . subTable hunk ./src/Haddock/Backends/Xhtml/Layout.hs 105 -subFields = divSubDecls "fields" "Fields" . subDlist +subFields = divSubDecls "fields" "Fields" . subTable hunk ./html/xhaddock.css 209 - padding: 3px; - background-color: #f0f0f0; - font-family: monospace; + padding: 3px; + background-color: #f0f0f0; + font-family: monospace; hunk ./html/xhaddock.css 264 +.arguments .caption, hunk ./html/xhaddock.css 269 +/* need extra .subs in the selector to make it override the rules for .subs and .subs table */ + +.subs.arguments { + margin: 0; +} + +.subs.arguments table { + border-spacing: 0; + margin-top: 0; + margin-bottom: 0; +} + +.subs.arguments td.src { + white-space: nowrap; +} + +.subs.arguments + p { + margin-top: 0; +} + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 70 - (vanillaTable << ( - do_args 0 sep typ > - (case doc of - Just d -> ndocBox (docToHtml d) - Nothing -> emptyTable) - )) + subArguments (do_args 0 sep typ) +++ maybeDocToHtml doc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 72 - argDocHtml n = case Map.lookup n argDocs of - Just adoc -> docToHtml adoc - Nothing -> noHtml + argDoc n = Map.lookup n argDocs hunk ./src/Haddock/Backends/Xhtml/Decl.hs 75 - do_args :: Int -> Html -> (HsType DocName) -> HtmlTable + do_args :: Int -> Html -> (HsType DocName) -> [SubDecl] hunk ./src/Haddock/Backends/Xhtml/Decl.hs 77 - = (argBox ( - leader <+> + = (leader <+> hunk ./src/Haddock/Backends/Xhtml/Decl.hs 79 - ppLContextNoArrow lctxt unicode) - <-> rdocBox noHtml) > - do_largs n (darrow unicode) ltype + ppLContextNoArrow lctxt unicode, + Nothing, []) + : do_largs n (darrow unicode) ltype hunk ./src/Haddock/Backends/Xhtml/Decl.hs 84 - = (argBox (leader <+> ppLContextNoArrow lctxt unicode) - <-> rdocBox noHtml) > - do_largs n (darrow unicode) ltype + = (leader <+> ppLContextNoArrow lctxt unicode, + Nothing, []) + : do_largs n (darrow unicode) ltype hunk ./src/Haddock/Backends/Xhtml/Decl.hs 92 - = (argBox (leader <+> ppLFunLhType unicode lt) <-> rdocBox (argDocHtml n)) - > do_largs (n+1) (arrow unicode) r + = (leader <+> ppLFunLhType unicode lt, argDoc n, []) + : do_largs (n+1) (arrow unicode) r hunk ./src/Haddock/Backends/Xhtml/Decl.hs 95 - = argBox (leader <+> ppType unicode t) <-> rdocBox (argDocHtml n) + = (leader <+> ppType unicode t, argDoc n, []) : [] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 23 + subArguments, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 102 + +subArguments :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subArguments = divSubDecls "arguments" "Arguments" . subTable + hunk ./html/xhaddock.css 299 -p.inst-header { - font-weight: bold; - margin-bottom: 0; -} hunk ./html/xhaddock.css 300 -p.inst-header img { +img.coll { hunk ./html/xhaddock.css 304 -ul.int { - margin-top: 1em; - margin-bottom: 1em; -} -ul.inst li { - background-color: #f0f0f0; - font-family: monospace; - vertical-align: top; - margin-top: 1px; - margin-bottom: 1px; - padding: 2px; - margin-left: 20px; - list-style-type: none; -} hunk ./src/Haddock/Backends/Xhtml/Decl.hs 395 - | null instances = noHtml - | otherwise = - instHdr instId +++ - collapsed thediv instId ( - spacedTable1 << aboves (map (ppDocInstance unicode) instances) - ) + = subInstances instId (map instDecl instances) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 398 - --- | Print a possibly commented instance. The instance header is printed inside --- an 'argBox'. The comment is printed to the right of the box in normal comment --- style. -ppDocInstance :: Bool -> DocInstance DocName -> HtmlTable -ppDocInstance unicode (instHead, maybeDoc) = - argBox (ppInstHead unicode instHead) <-> maybeRDocBox maybeDoc - - -ppInstHead :: Bool -> InstHead DocName -> Html -ppInstHead unicode ([], n, ts) = ppAppNameTypes n ts unicode -ppInstHead unicode (ctxt, n, ts) = ppContextNoLocs ctxt unicode <+> ppAppNameTypes n ts unicode + instDecl :: DocInstance DocName -> SubDecl + instDecl (inst, maybeDoc) = (instHead inst, maybeDoc, []) + instHead ([], n, ts) = ppAppNameTypes n ts unicode + instHead (ctxt, n, ts) = ppContextNoLocs ctxt unicode <+> ppAppNameTypes n ts unicode hunk ./src/Haddock/Backends/Xhtml/Layout.hs 24 - subConstructors, subFields, + subConstructors, + subFields, + subInstances, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 30 - instHdr, atHdr, methHdr, + atHdr, methHdr, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 75 -divSubDecls :: String -> String -> Maybe Html -> Html +divSubDecls :: (HTML a) => String -> a -> Maybe Html -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 114 +subInstances :: String -> [(Html, Maybe (Doc DocName), [Html])] -> Html +subInstances id_ = divSubDecls "instances" instCaption . instTable + where + instCaption = collapsebutton id_ +++ " Instances" + instTable = (collapsed thediv id_ `fmap`) . subTable hunk ./src/Haddock/Backends/Xhtml/Layout.hs 188 - -instHdr :: String -> Html -instHdr id_ = - h5 << (collapsebutton id_ +++ toHtml " Instances") hunk ./src/Haddock/Backends/Xhtml/Layout.hs 31 - argBox, ndocBox, rdocBox, maybeRDocBox, - - vanillaTable, vanillaTable2, spacedTable1, spacedTable5 + argBox, vanillaTable, vanillaTable2 hunk ./src/Haddock/Backends/Xhtml/Layout.hs 161 --- a box for displaying documentation, not indented. -ndocBox :: Html -> HtmlTable -ndocBox html = tda [theclass "ndoc"] << html - --- a box for displaying documentation, padded on the left a little -rdocBox :: Html -> HtmlTable -rdocBox html = tda [theclass "rdoc"] << html - -maybeRDocBox :: Maybe (Doc DocName) -> HtmlTable -maybeRDocBox Nothing = rdocBox (noHtml) -maybeRDocBox (Just doc) = rdocBox (docToHtml doc) - - hunk ./src/Haddock/Backends/Xhtml/Layout.hs 166 -spacedTable1, spacedTable5 :: Html -> Html -spacedTable1 = table ! [theclass "vanilla", cellspacing 1, cellpadding 0] -spacedTable5 = table ! [theclass "vanilla", cellspacing 5, cellpadding 0] hunk ./html/xhaddock.css 289 +.subs.associated-types, +.subs.methods { + margin-left: 20px; +} + +.subs.associated-types .caption, +.subs.methods .caption { + margin-top: 0.5em; + margin-left: -10px; +} + +.subs.associated-types .src + .src, +.subs.methods .src + .src { + margin-top: 8px; +} + hunk ./src/Haddock/Backends/Xhtml/Decl.hs 369 - atBit - | null ats = noHtml - | otherwise = atHdr +++ ( - thediv ! [theclass "subdecl"] << - concatHtml [ ppAssocType summary links doc at unicode + atBit = subAssociatedTypes [ ppAssocType summary links doc at unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 372 - ) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 373 - methodBit - | null lsigs = noHtml - | otherwise = methHdr +++ ( - thediv ! [theclass "subdecl"] << - concatHtml [ ppFunSig summary links loc doc n typ unicode + methodBit = subMethods [ ppFunSig summary links loc doc n typ unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 376 - ) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 24 + subAssociatedTypes, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 28 + subMethods, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 32 - atHdr, methHdr, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 102 - hunk ./src/Haddock/Backends/Xhtml/Layout.hs 103 -subArguments :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subBlock :: [Html] -> Maybe Html +subBlock [] = Nothing +subBlock hs = Just $ toHtml hs + + +subArguments :: [SubDecl] -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 111 -subConstructors :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subAssociatedTypes :: [Html] -> Html +subAssociatedTypes = divSubDecls "associated-types" "Associated Types" . subBlock + +subConstructors :: [SubDecl] -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 117 -subFields :: [(Html, Maybe (Doc DocName), [Html])] -> Html +subFields :: [SubDecl] -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 120 -subInstances :: String -> [(Html, Maybe (Doc DocName), [Html])] -> Html +subInstances :: String -> [SubDecl] -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 126 +subMethods :: [Html] -> Html +subMethods = divSubDecls "methods" "Methods" . subBlock + + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 177 - - -methHdr, atHdr :: Html -methHdr = h5 << "Methods" -atHdr = h5 << "Associated Types" hunk ./html/xhaddock.css 173 -#synopsis p.src { - padding: 0; +#synopsis ul { + margin: 0; + padding-top: 0; + padding-left: 20px; + list-style-type: none; hunk ./html/xhaddock.css 179 + hunk ./html/xhaddock.css 181 - background-color: #f0f0f0; - font-family: monospace; - vertical-align: top; hunk ./html/xhaddock.css 184 - list-style-type: none; hunk ./html/xhaddock.css 186 -#synopsis ul { - margin: 0; - padding-top: 0; -} - -#synopsis li ul li { - margin: 3px; +#synopsis li li { hunk ./html/xhaddock.css 188 + margin-top: 0; + margin-bottom: 0; hunk ./src/Haddock/Backends/Xhtml/Decl.hs 67 - | summary = declElem pref1 + | summary = pref1 hunk ./src/Haddock/Backends/Xhtml/Decl.hs 162 - | summary = declElem (ppTyFamHeader True associated decl unicode) + | summary = ppTyFamHeader True associated decl unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 202 - | summary = declElem(ppTyInstHeader True associated decl unicode) + | summary = ppTyInstHeader True associated decl unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 334 - then (if summary then declElem else topDeclElem links loc nm) hdr - else (if summary then declElem else topDeclElem links loc nm) (hdr <+> keyword "where") - +++ vanillaTable << aboves + then (if summary then id else topDeclElem links loc nm) hdr + else (if summary then id else topDeclElem links loc nm) (hdr <+> keyword "where") + +++ shortSubDecls hunk ./src/Haddock/Backends/Xhtml/Decl.hs 338 - [ argBox $ ppAssocType summary links doc at unicode | at <- ats + [ ppAssocType summary links doc at unicode | at <- ats hunk ./src/Haddock/Backends/Xhtml/Decl.hs 341 - [ argBox $ ppFunSig summary links loc doc n typ unicode + [ ppFunSig summary links loc doc n typ unicode hunk ./src/Haddock/Backends/Xhtml/Decl.hs 410 - | [] <- cons = declElem dataHeader + | [] <- cons = dataHeader hunk ./src/Haddock/Backends/Xhtml/Decl.hs 414 - = declElem (dataHeader <+> equals <+> cHead) +++ cBody +++ cFoot + = (dataHeader <+> equals <+> cHead) +++ cBody +++ cFoot hunk ./src/Haddock/Backends/Xhtml/Decl.hs 416 - | ResTyH98 <- resTy = declElem dataHeader - +++ unordList (zipWith doConstr ('=':repeat '|') cons) + | ResTyH98 <- resTy = dataHeader + +++ shortSubDecls (zipWith doConstr ('=':repeat '|') cons) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 419 - | otherwise = declElem (dataHeader <+> keyword "where") - +++ unordList (map doGADTConstr cons) + | otherwise = (dataHeader <+> keyword "where") + +++ shortSubDecls (map doGADTConstr cons) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 496 - doRecordFields fields = unordList (map (ppShortField summary unicode) fields) + doRecordFields fields = shortSubDecls (map (ppShortField summary unicode) fields) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 20 + shortSubDecls, + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 34 - argBox, vanillaTable, vanillaTable2 + vanillaTable, vanillaTable2 hunk ./src/Haddock/Backends/Xhtml/Layout.hs 70 +shortSubDecls :: [Html] -> Html +shortSubDecls items = ulist ! [theclass "subs"] << map (li <<) items + + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 172 --- a box for displaying an 'argument' (some code which has text to the --- right of it). Wrapping is not allowed in these boxes, whereas it is --- in a declBox. -argBox :: Html -> HtmlTable -argBox html = tda [theclass "arg"] << html - - hunk ./src/Haddock/Backends/Xhtml/Names.hs 46 -linkTarget :: OccName -> Html -linkTarget n = namedAnchor (anchorNameStr n) << toHtml "" - hunk ./src/Haddock/Backends/Xhtml/Names.hs 54 -ppBinder False n = linkTarget n +++ bold << ppBinder' n +ppBinder False n = namedAnchor (anchorNameStr n) << bold << ppBinder' n hunk ./src/Haddock/Backends/Xhtml/Util.hs 180 --- This actually generates two anchor tags, one with the name unescaped, and one +-- This used to generate two anchor tags, one with the name unescaped, and one hunk ./src/Haddock/Backends/Xhtml/Util.hs 183 --- -namedAnchor :: String -> Html -> Html -namedAnchor n c = anchor ! [Html.name n] << noHtml +++ - anchor ! [Html.name (escapeStr n)] << c +-- The escaped form for IE 7 is probably erroneous and not needed... hunk ./src/Haddock/Backends/Xhtml/Util.hs 185 +namedAnchor :: String -> Html -> Html +namedAnchor n c = anchor ! [Html.name n] << c hunk ./src/Haddock/Backends/Xhtml/Util.hs 188 +linkedAnchor :: String -> Html -> Html +linkedAnchor frag = anchor ! [href hr_] + where hr_ | null frag = "" + | otherwise = '#': escapeStr frag + -- this escape function is over-zealous for the fragment part of a URI + -- (':' for example does not need to be escaped) + hunk ./src/Haddock/Backends/Xhtml/Util.hs 216 -linkedAnchor :: String -> Html -> Html -linkedAnchor frag = anchor ! [href hr_] - where hr_ | null frag = "" - | otherwise = '#': escapeStr frag - hunk ./html/haddock-util.js 141 + +function setActiveStyleSheet(href) { + var i, a, main; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + if(a.getAttribute("href") == href) a.disabled = false; + //a.disabled = a.getAttribute("title") != title; + } + } +} + addfile ./html/shaddock.css hunk ./html/shaddock.css 1 +/* -------- Global things --------- */ + +@font-face { + font-family: 'DroidSerif'; + src: url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Regular.eot'); + src: local('Droid Serif'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Regular.woff') format('woff'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Regular.ttf') format('truetype'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Regular.svg#DroidSerif') format('svg'); +} + +@font-face { + font-family: 'DroidSerif'; + font-style: italic; + src: url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Italic.eot'); + src: local('Droid Serif'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Italic.woff') format('woff'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Italic.ttf') format('truetype'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Italic.svg#DroidSerif-Italic') format('svg'); +} + +@font-face { + font-family: 'DroidSerif'; + font-weight: bold; + src: url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Bold.eot'); + src: local('Droid Serif'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Bold.woff') format('woff'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Bold.ttf') format('truetype'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-Bold.svg#DroidSerif-Bold') format('svg'); +} + +@font-face { + font-family: 'DroidSerif'; + src: url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-BoldItalic.eot'); + font-weight: bold; + font-style: italic; + src: local('Droid Serif'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-BoldItalic.woff') format('woff'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-BoldItalic.ttf') format('truetype'), + url('http://snapframework.com/docs/latest/snap-core/fonts/DroidSerif-BoldItalic.svg#DroidSerif-BoldItalic') format('svg'); +} + + + +html { + background-color: #f0f3ff; + width: 100%; +} + +body { + -moz-border-radius:5px; + -webkit-border-radius:5px; + width: 50em; + margin: 2em auto; + padding: 0; + background-color: #ffffff; + color: #000000; + font-size: 110%; + font-family: DroidSerif, Georgia, serif; + } + +div { + padding: 0 30px; +} + + + +a:link { color: #5200A3; text-decoration: none } +a:visited { color: #5200A3; text-decoration: none } +a:hover { color: #5200A3; text-decoration: none; border-bottom:#5200A3 dashed 1px; } + +table{ + border-spacing: 1px 1px; +} + +td { + border-width: 0px; + vertical-align: top; +} + +p { + margin-top: 0; + margin-bottom: 0.75em; + padding-left: 4px; + font-size: 95%; + line-height: 1.66; + } + +li p { margin: 0pt } + + +tt, pre, code { + font-family: Monaco, + "DejaVu Sans Mono", + "Bitstream Vera Sans Mono", + "Lucida Console", + monospace; + font-size: 90%; +} + +.src { + padding: 4px 8px; + background-color: #f0f0f0; + font-size: 80%; + font-family: Monaco, + "DejaVu Sans Mono", + "Bitstream Vera Sans Mono", + "Lucida Console", + monospace; + + vertical-align: top; + white-space: nowrap; +} + +ul { + padding: 0; +} + +ul ul { + padding-left: 30px; +} + +ul.links { + list-style: none; + position: absolute; + right: 1px; + top: 0; + margin: 0; +} + +ul.links li { + display: inline; + white-space: nowrap; +} + + + +/* Captions and Headers */ + +p.caption, h1, h2, h3, h4 { + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + margin: 0; + padding: 0; + font-size: inherit; + line-height: inherit; +} + +#module-header .caption { + font-weight: bold; letter-spacing: -0.02em; + font-size: 201%; + margin: 0; + padding: 0; +} + +h1, +#description .caption, +#synopsis .caption { + padding-top: 14px; + margin-bottom: 0; + font-weight: bold; + letter-spacing: -0.02em; + font-size: 140% + } + +h2 { + padding-top: 14px; + font-weight: bold; + letter-spacing: -0.02em; + font-size: 120% +} + +h3 { + padding-top: 12px; + font-weight: bold; + letter-spacing: -0.02em; + font-size: 105% +} + +h4, +#table-of-contents .caption, +.constructors .caption, +.instances .caption, +.methods .caption { + font-weight: bold; + padding-top: 12px; + padding-bottom: 4px; + letter-spacing: -0.02em; + font-size: 90% +} + +.arguments .caption, +.fields .caption { + display: none; +} + +/* Per Section Styling */ + +#package-header { + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + background: #3465a4 url(haskell_icon.gif) no-repeat 4px 3px; + padding: 0; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + -webkit-border-radius-topleft:5px; + -webkit-border-radius-topright:5px; + position: relative; +} + +#package-header li { + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + padding-left: 5px; + padding-right: 5px; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + letter-spacing: -0.02em; + font-weight: bold; +} + +#package-header a { color: #ffffff } +#package-header a:visited { color: #ffff00 } +#package-header a:hover { background-color: #C9D3DE; } +#package-header li:hover { background-color: #C9D3DE; } + +#module-header { + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + color: #141B24; + background-color: #C9D3DE; + padding: 5px; + border-top-width: 1px; + border-top-color: #ffffff; + border-top-style: solid; + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -webkit-border-radius-bottomleft:5px; + -webkit-border-radius-bottomright:5px; +} + +#module-header .info { + display: none; +} + +#table-of-contents, +#description, +#synopsis, +#footer { + margin-top: 15px; +} + +#table-of-contents ul { + font-size: 80%; + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + letter-spacing: -0.01em; + margin: 0; + list-style: none; +} + +#synopsis ul { + list-style: none; +} + +#synopsis .src, +.instances .src { + background-color: #FAFAFA; + border-bottom: #F2F2F2 solid 1px; + border-top: #FCFCFC solid 1px; +} + +.top { + padding: 20px 0 0.5ex 0; +} + +.top .src, +#interface .subs.methods .src { + border-spacing: 0px; + border-bottom:1px solid #d7d7df; + border-right:1px solid #d7d7df; + border-top:1px solid #f4f4f9; + border-left:1px solid #f4f4f9; + padding: 4px; +} + +#interface p + div { + margin-top: -15px +} + +.subs p { + margin: 0; +} + +#interface .subs .src { + padding: 2px 12px; + border: none; +} + +#interface .subs td + td { + font-style: italic; + font-size: 80%; + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; +} + +#interface .methods .src { + margin-top: 15px; +} +#interface .instances div { + margin: 0; + padding: 0; +} + +div.arguments { + padding-left: 0; + padding-top: 9px; +} + +.arguments table { + border-spacing: 0; +} + +#footer { + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + -moz-border-radius:5px; + -webkit-border-radius:5px; + background-color: #3465a4; + color: #ffffff; + padding: 5px +} + +#footer p { + margin: 0; +} + +#footer a:link { + color: #ffffff; + text-decoration: underline + } +#footer a:visited { + color: #ffff00 + } +#footer a:hover { + background-color: #6060ff + } + + + addfile ./html/thaddock.css hunk ./html/thaddock.css 1 +html, body { + height:100%; + margin:0; + padding:0; +} + +body { + background-color:#FFFFFF; + color:#000000; + font-family:Helvetica,Arial,sans-serif; + font-size:small; + margin:3px 8px; + + max-width:956px; + padding-left:24px; +} + +#package-header { + background: #eaeaea url(haskell_icon.gif) no-repeat 5px 6px; + height: 2em; + margin: 0 0 0 -10px; + position: relative; +} + +#module-header .caption { + background:transparent none repeat scroll 0 0; + border:medium none; + font-size: 170%; + line-height: 130%; + margin:0 0 0 -10px; + /* padding:0.8em 0 0; */ + + background-color:#E5ECF9; + border-top:1px solid #3366CC; + padding:1px 3px; + font-weight: bold; + position: relative; +} + + +dl.info { + position: absolute; + display: block; + right: 1em; + top: 3em; + background-color:#FAFAFA; + border:1px solid #BBBBBB; + padding:0.99em; +} + +dl.info dt { + float: left; + clear: left; + width: 5em; + font-weight: bold; + margin: 0; + padding: 0; +} + +dl.info dd { + padding-left: 6em; + margin: 0; +} + +#description .caption, +#synopsis .caption, +h1 { + background-color:#E5ECF9; + border-top:1px solid #3366CC; + font-size:130%; + font-weight:bold; + margin:2em 0 0 -10px; + padding:1px 3px; + position:relative; +} + +#table-of-contents .caption, +h2 { + font-size:130%; + font-weight:bold; + margin:1.5em 0 0; + padding: 0; + top:0; +} + +#synopsis li.src * { + display: inline; +} + +#synopsis ul.subs, +#synopsis ul.subs li { + padding: 0 0 0 0.25em; + margin: 0; +} + +#footer { + color:#666666; + background-color: #eaeaea; + margin: 2em 0 0 -10px; + position: relative; +} + +#footer p { + margin: 0; + padding: 0.5em; + border-top: 1px solid #919191; +} + +ol, ul { + line-height:125%; + margin:0.5em 0 0 15px; + padding:0; +} + +li { + margin:0.3em 0 0 1.5em; + padding:0; +} + +p { + line-height:125%; + margin:0; + padding:0; +} + +h1 + p, h2 + p, h3 + p, +pre + p, +p + p { + padding-top: 1em; +} + +code, pre { + color:#007000; + font-family:monospace; +} + +pre { + background-color:#FAFAFA; + border:1px solid #BBBBBB; + font-size:9pt; + line-height:125%; + margin:1em 0 0; + overflow:auto; + padding:0.99em; +} + +code { + font-size:10pt; +} + +a, a:link { + color:#0000CC; +} + +ul.links { + list-style: none; + position: absolute; + right: 1px; + top: 0; +} + +ul.links li { + display: inline; + white-space: nowrap; + padding: 0 10px; + border-left: 1px solid #919191; + margin: 0; +} + +dl { + line-height:125%; + margin:0; + padding:0; +} + +dt { + font-weight:normal; + margin:0.75em 0 0; + padding:0; +} + +dd { + font-weight:normal; + margin:0.4em 0 0 2em; + padding:0; +} + +.top, .subs { + margin:0.4em 0 0 2em; + padding:0; +} + +.top .src { + font-family:monospace; + font-size:larger; + font-weight:bold; + margin:0.75em 0 0 -2em; + padding:0; +} + +.top .subs .src { + margin-left: 0; +} + +.arguments { + margin: 0 0 1em; +} +.arguments .caption, +.fields .caption { + display: none; +} + +.associated-types, +.constructors, +.methods { + background-color:#FAFAFA; + border:1px solid #BBBBBB; + padding:0.99em; +} + +.caption { + margin-top: 0; + padding-top: 0; +} + +.subs .caption { + font-weight: bold; + color: #919100; +} + +.subs td { + padding-right: 1em; + padding-left: 1em; +} hunk ./src/Haddock/Backends/Xhtml.hs 141 -copyHtmlBits odir libdir maybe_css = do +copyHtmlBits odir libdir _maybe_css = do hunk ./src/Haddock/Backends/Xhtml.hs 144 + {- hunk ./src/Haddock/Backends/Xhtml.hs 149 + -} hunk ./src/Haddock/Backends/Xhtml.hs 152 - copyFile css_file css_destination + --copyFile css_file css_destination + mapM_ copyLibFile cssFiles hunk ./src/Haddock/Backends/Xhtml.hs 207 - ]) ! [theclass "links"] + ] ++ stylePickers) ! [theclass "links"] hunk ./src/Haddock/Backends/Xhtml.hs 223 - ]) ! [theclass "links"] + ] ++ stylePickers) ! [theclass "links"] hunk ./src/Haddock/Backends/Xhtml/Util.hs 29 - documentCharacterEncoding, styleSheet + documentCharacterEncoding, + + cssFiles, styleSheet, stylePickers hunk ./src/Haddock/Backends/Xhtml/Util.hs 222 +-- Standard set of style sheets, first is the preferred +cssThemes :: [(String, String)] +cssThemes = [ + ("Classic", "xhaddock.css"), + ("Tibbe", "thaddock.css"), + ("Snappy", "shaddock.css") + ] + +cssFiles :: [String] +cssFiles = map snd cssThemes + hunk ./src/Haddock/Backends/Xhtml/Util.hs 234 -styleSheet = - (thelink ! [href cssFile, rel "stylesheet", thetype "text/css"]) noHtml +styleSheet = toHtml $ zipWith mkLink cssThemes rels + where + rels = ("stylesheet" : repeat "alternate stylesheet") + mkLink (aTitle, aFile) aRel = + (thelink ! [href aFile, rel aRel, thetype "text/css", Html.title aTitle]) noHtml hunk ./src/Haddock/Backends/Xhtml/Util.hs 240 +stylePickers :: [Html] +stylePickers = map mkPicker cssThemes + where + mkPicker (aTitle, aFile) = + let js = "setActiveStyleSheet('" ++ aFile ++ "'); return false;" in + anchor ! [href "#", onclick js] << aTitle + hunk ./html/haddock-util.js 139 + resetStyle(); // ugly: we are using setSynopsis as a hook! hunk ./html/haddock-util.js 144 - var i, a, main; - for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { - if(a.getAttribute("rel").indexOf("style") != -1 - && a.getAttribute("title")) { - a.disabled = true; - if(a.getAttribute("href") == href) a.disabled = false; - //a.disabled = a.getAttribute("title") != title; - } - } + var i, a, found = false; + for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + // need to do this always, some browsers are edge triggered + if(a.getAttribute("href") == href) { + a.disabled = false; + found = true; + } + } + } + if (!found) href = ""; + document.cookie = "style=" + href + ";path=/"; + styleMenu(false); hunk ./html/haddock-util.js 160 + +function resetStyle() { + var nameEQ = "style="; + var s; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) s = c.substring(nameEQ.length,c.length); + } + if (s) setActiveStyleSheet(s); +} + + +function styleMenu(show) { + var m = document.getElementById('style-menu'); + if (show == null) { show = m.className == "hide"; } + m.className = show ? "show" : "hide"; +} + hunk ./html/shaddock.css 136 - +.hide { display: none; } +.show { } hunk ./html/shaddock.css 149 +#package-header .caption { + font-size: 80%; + font-weight: bold; + padding-left: 26px; + padding-top: 2px; + padding-bottom: 3px; +} + hunk ./html/shaddock.css 234 +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; + margin: 0; + padding: 0; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #3465a4; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 0 2px 1px; + border-left: 1px solid #fffffff; + border-right: 1px solid #fffffff; + border-bottom: 1px solid #fffffff; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #ffffff; +} + hunk ./html/thaddock.css 25 +#package-header .caption { + margin-left: 30px; + padding-top: 6px; +} + + + +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { + position: absolute; + z-index: 1; + overflow: visible; + background-color: #eaeaea; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 0 2px 1px; + border-left: 1px solid #919191; + border-right: 1px solid #919191; + border-bottom: 1px solid #919191; +} + +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; +} + +#style-menu li + li { + border-top: 1px solid #919191; +} + hunk ./html/thaddock.css 229 +.hide { display: none; } +.show { } + hunk ./html/xhaddock.css 79 +ul.links { + list-style: none; + text-align: left; + position: absolute; + right: 5px; + top: 5px; + display: inline-table; +} + +ul.links li { + display: inline; + border-left-width: 1px; + border-left-color: #ffffff; + border-left-style: solid; + white-space: nowrap; + padding: 1px 5px; +} + +.hide { display: none; } +.show { } hunk ./html/xhaddock.css 108 +#package-header .caption { + font-weight: normal; + font-style: normal; +} hunk ./html/xhaddock.css 117 -ul.links { - list-style: none; - text-align: left; +div#style-menu-holder { + position: relative; + z-index: 2; + display: inline; +} + +#style-menu { hunk ./html/xhaddock.css 125 - right: 5px; - top: 5px; - display: inline-table; + z-index: 1; + overflow: visible; + background-color: #000099; + margin: 0; + width: 6em; + text-align: center; + right: 0; + padding: 2px 2px 1px; hunk ./html/xhaddock.css 135 -ul.links li { - display: inline; - border-left-width: 1px; - border-left-color: #ffffff; - border-left-style: solid; - white-space: nowrap; - padding: 1px 5px; +#style-menu li { + display: list-item; + border-style: none; + margin: 0; + padding: 3px; + color: #000; + list-style-type: none; + border-top: 1px solid #ffffff; hunk ./src/Haddock/Backends/Xhtml.hs 207 - ] ++ stylePickers) ! [theclass "links"] + ] ++ [styleMenu]) ! [theclass "links"] hunk ./src/Haddock/Backends/Xhtml.hs 223 - ] ++ stylePickers) ! [theclass "links"] + ] ++ [styleMenu]) ! [theclass "links"] hunk ./src/Haddock/Backends/Xhtml/Util.hs 31 - cssFiles, styleSheet, stylePickers + cssFiles, styleSheet, stylePickers, styleMenu hunk ./src/Haddock/Backends/Xhtml/Util.hs 246 - + +styleMenu :: Html +styleMenu = thediv ! [identifier "style-menu-holder"] << [ + anchor ! [ href "#", onclick js ] << "Style\9662", + unordList stylePickers ! [ identifier "style-menu", theclass "hide" ] + ] + where + js = "styleMenu(); return false;" + hunk ./src/Haddock/Backends/Xhtml.hs 600 - body << thediv ! [ theclass "outer" ] << ( - (thediv ! [theclass "mini-topbar"] - << toHtml (moduleString mdl)) +++ + miniBody << + (divModuleHeader << sectionName << moduleString mdl +++ hunk ./src/Haddock/Backends/Xhtml.hs 656 - thediv ! [ theclass "mini-synopsis" ] - << hsep (map (processForMiniSynopsis mdl unicode) $ exports) + divInterface << mapMaybe (processForMiniSynopsis mdl unicode) exports hunk ./src/Haddock/Backends/Xhtml.hs 660 -processForMiniSynopsis :: Module -> Bool -> ExportItem DocName -> Html +processForMiniSynopsis :: Module -> Bool -> ExportItem DocName -> Maybe Html hunk ./src/Haddock/Backends/Xhtml.hs 662 - thediv ! [theclass "decl" ] << - case decl0 of - TyClD d@(TyFamily{}) -> ppTyFamHeader True False d unicode - TyClD d@(TyData{tcdTyPats = ps}) - | Nothing <- ps -> keyword "data" <+> ppTyClBinderWithVarsMini mdl d - | Just _ <- ps -> keyword "data" <+> keyword "instance" - <+> ppTyClBinderWithVarsMini mdl d - TyClD d@(TySynonym{tcdTyPats = ps}) - | Nothing <- ps -> keyword "type" <+> ppTyClBinderWithVarsMini mdl d - | Just _ <- ps -> keyword "type" <+> keyword "instance" - <+> ppTyClBinderWithVarsMini mdl d - TyClD d@(ClassDecl {}) -> - keyword "class" <+> ppTyClBinderWithVarsMini mdl d + ((divTopDecl <<).(declElem <<)) `fmap` case decl0 of + TyClD d -> let b = ppTyClBinderWithVarsMini mdl d in case d of + (TyFamily{}) -> Just $ ppTyFamHeader True False d unicode + (TyData{tcdTyPats = ps}) + | Nothing <- ps -> Just $ keyword "data" <+> b + | Just _ <- ps -> Just $ keyword "data" <+> keyword "instance" <+> b + (TySynonym{tcdTyPats = ps}) + | Nothing <- ps -> Just $ keyword "type" <+> b + | Just _ <- ps -> Just $ keyword "type" <+> keyword "instance" <+> b + (ClassDecl {}) -> Just $ keyword "class" <+> b + _ -> Nothing hunk ./src/Haddock/Backends/Xhtml.hs 674 - let nm = docNameOcc n - in ppNameMini mdl nm - _ -> noHtml + Just $ ppNameMini mdl (docNameOcc n) + _ -> Nothing hunk ./src/Haddock/Backends/Xhtml.hs 677 - let heading - | lvl == 1 = h1 - | lvl == 2 = h2 - | lvl >= 3 = h3 - | otherwise = error "bad group level" - in heading << docToHtml txt -processForMiniSynopsis _ _ _ = noHtml + Just $ groupTag lvl << docToHtml txt +processForMiniSynopsis _ _ _ = Nothing hunk ./src/Haddock/Backends/Xhtml/Layout.hs 14 + miniBody, + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 51 +miniBody :: Html -> Html +miniBody = body ! [identifier "mini"] + hunk ./src/Haddock/Backends/Xhtml.hs 36 -import qualified Text.XHtml as Html hunk ./src/Haddock/Backends/Xhtml.hs 394 - body << vanillaTable << Html.p << ( - foldr (+++) noHtml (map (+++br) mods)) + miniBody << divModuleList << + (sectionName << "Modules" +++ shortDeclList mods) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 17 - divTableOfContents, divDescription, divSynposis, divInterface, - + divModuleList, divTableOfContents, + divDescription, divSynposis, divInterface, + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 60 -divTableOfContents, divDescription, divSynposis, divInterface :: Html -> Html +divModuleList, divTableOfContents, + divDescription, divSynposis, divInterface :: Html -> Html +divModuleList = thediv ! [identifier "module-list"] hunk ./src/Haddock/Backends/Xhtml.hs 50 +import Data.List ( intercalate ) hunk ./src/Haddock/Backends/Xhtml.hs 274 - simpleHeader doctitle Nothing maybe_index_url - maybe_source_url maybe_wiki_url +++ - vanillaTable << ( - ppPrologue doctitle prologue > - ppModuleTree doctitle tree) +++ - footer + simpleHeader doctitle Nothing maybe_index_url + maybe_source_url maybe_wiki_url +++ + ppPrologue doctitle prologue +++ + ppModuleTree tree +++ + footer hunk ./src/Haddock/Backends/Xhtml.hs 294 -ppPrologue :: String -> Maybe (Doc GHC.RdrName) -> HtmlTable -ppPrologue _ Nothing = emptyTable -ppPrologue title (Just doc) = - (tda [theclass "section1"] << toHtml title) > - (tda [theclass "doc"] << (rdrDocToHtml doc)) +ppPrologue :: String -> Maybe (Doc GHC.RdrName) -> Html +ppPrologue _ Nothing = noHtml +ppPrologue title (Just doc) = + divDescription << (h1 << title +++ rdrDocToHtml doc) hunk ./src/Haddock/Backends/Xhtml.hs 299 -ppModuleTree :: String -> [ModuleTree] -> HtmlTable -ppModuleTree _ ts = - tda [theclass "section1"] << toHtml "Modules" > - td << vanillaTable2 << htmlTable - where - genTable tbl id_ [] = (tbl, id_) - genTable tbl id_ (x:xs) = genTable (tbl > u) id' xs - where - (u,id') = mkNode [] x 0 id_ - - (htmlTable,_) = genTable emptyTable 0 ts +ppModuleTree :: [ModuleTree] -> Html +ppModuleTree ts = + divModuleList << (sectionName << "Modules" +++ mkNodeList [] "n" ts) hunk ./src/Haddock/Backends/Xhtml.hs 303 -mkNode :: [String] -> ModuleTree -> Int -> Int -> (HtmlTable,Int) -mkNode ss (Node s leaf pkg short ts) depth id_ = htmlNode +mkNodeList :: [String] -> String -> [ModuleTree] -> Html +mkNodeList ss p ts = case ts of + [] -> noHtml + _ -> unordList (zipWith (mkNode ss) ps ts) hunk ./src/Haddock/Backends/Xhtml.hs 308 - htmlNode = case ts of - [] -> (td_pad_w 1.25 depth << htmlModule <-> shortDescr <-> htmlPkg,id_) - _ -> (td_w depth << (collapsebutton id_s +++ htmlModule) <-> shortDescr <-> htmlPkg > - (td_subtree << sub_tree), id') - - mod_width = 50::Int {-em-} - - td_pad_w :: Double -> Int -> Html -> HtmlTable - td_pad_w pad depth_ = - tda [thestyle ("padding-left: " ++ show pad ++ "em;" ++ - "width: " ++ show (mod_width - depth_*2) ++ "em")] - - td_w depth_ = - tda [thestyle ("width: " ++ show (mod_width - depth_*2) ++ "em")] - - td_subtree = - tda [thestyle ("padding: 0; padding-left: 2em")] - - shortDescr :: HtmlTable - shortDescr = case short of - Nothing -> cell $ td empty - Just doc -> tda [theclass "rdoc"] (origDocToHtml doc) - + ps = [ p ++ '.' : show i | i <- [(1::Int)..]] + +mkNode :: [String] -> String -> ModuleTree -> Html +mkNode ss p (Node s leaf pkg short ts) = + collBtn +++ htmlModule +++ shortDescr +++ htmlPkg +++ subtree + where + collBtn = case ts of + [] -> noHtml + _ -> collapsebutton p + hunk ./src/Haddock/Backends/Xhtml.hs 319 - | leaf = ppModule (mkModule (stringToPackageId pkgName) + | leaf = ppModule (mkModule (stringToPackageId (fromMaybe "" pkg)) hunk ./src/Haddock/Backends/Xhtml.hs 323 - -- ehm.. TODO: change the ModuleTree type - (htmlPkg, pkgName) = case pkg of - Nothing -> (td << empty, "") - Just p -> (td << toHtml p, p) - - mdl = foldr (++) "" (s' : map ('.':) ss') - (s':ss') = reverse (s:ss) - -- reconstruct the module name + mdl = intercalate "." (reverse (s:ss)) hunk ./src/Haddock/Backends/Xhtml.hs 325 - id_s = "n." ++ show id_ - - (sub_tree,id') = genSubTree emptyTable (id_+1) ts - - genSubTree :: HtmlTable -> Int -> [ModuleTree] -> (Html,Int) - genSubTree htmlTable id__ [] = (sub_tree_, id__) - where - sub_tree_ = collapsed vanillaTable2 id_s htmlTable - genSubTree htmlTable id__ (x:xs) = genSubTree (htmlTable > u) id__' xs - where - (u,id__') = mkNode (s:ss) x (depth+1) id__ + shortDescr = maybe noHtml origDocToHtml short + htmlPkg = maybe noHtml toHtml pkg + + subtree = mkNodeList (s:ss) p ts ! [identifier p] hunk ./src/Haddock/Backends/Xhtml.hs 361 - (sectionName << "Modules" +++ shortDeclList mods) + (sectionName << "Modules" +++ unordList mods) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 138 - instTable = (collapsed thediv id_ `fmap`) . subTable + instTable = fmap (thediv ! [identifier id_] <<) . subTable hunk ./src/Haddock/Backends/Xhtml/Util.hs 28 - collapsebutton, collapseId, collapsed, + collapsebutton, collapseId, hunk ./src/Haddock/Backends/Xhtml/Util.hs 209 -collapsed :: (HTML a) => (Html -> Html) -> String -> a -> Html -collapsed fn id_ html = - fn ! [identifier id_, thestyle "display:block;"] << html - hunk ./src/Haddock/Backends/Xhtml.hs 318 - htmlModule - | leaf = ppModule (mkModule (stringToPackageId (fromMaybe "" pkg)) + htmlModule = thespan ! [theclass "module" ] << + (if leaf + then ppModule (mkModule (stringToPackageId (fromMaybe "" pkg)) hunk ./src/Haddock/Backends/Xhtml.hs 322 - | otherwise = toHtml s - + else toHtml s + ) + hunk ./src/Haddock/Backends/Xhtml.hs 328 - htmlPkg = maybe noHtml toHtml pkg + htmlPkg = maybe noHtml (thespan ! [theclass "package"] <<) pkg hunk ./src/Haddock/Backends/Xhtml.hs 363 - (sectionName << "Modules" +++ unordList mods) + (sectionName << "Modules" +++ + ulist << [ li ! [theclass "module"] << m | m <- mods ]) hunk ./src/Haddock/Backends/Xhtml.hs 382 - let html = - header (documentCharacterEncoding +++ - thetitle (toHtml (doctitle ++ " (Index)")) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++ - body << ( - simpleHeader doctitle maybe_contents_url Nothing - maybe_source_url maybe_wiki_url +++ - vanillaTable << index_html - ) + let html = indexPage split_indices Nothing + (if split_indices then [] else index) hunk ./src/Haddock/Backends/Xhtml.hs 399 - where - - index_html - | split_indices = - tda [theclass "section1"] << - toHtml ("Index") > - indexInitialLetterLinks - | otherwise = - cell $ td << setTrClass (table ! [identifier "indexlist", cellpadding 0, cellspacing 5] << - aboves (map indexElt index)) - - -- an arbitrary heuristic: - -- too large, and a single-page will be slow to load - -- too small, and we'll have lots of letter-indexes with only one - -- or two members in them, which seems inefficient or - -- unnecessarily hard to use. - split_indices = length index > 150 - - setTrClass :: Html -> Html - setTrClass = id - -- XHtml is more strict about not allowing you to poke inside a structure - -- hence this approach won't work for now -- since the whole table is - -- going away soon, this is just disabled for now. -{- - setTrClass (Html xs) = Html $ map f xs - where - f (HtmlTag name attrs inner) - | map toUpper name == "TR" = HtmlTag name (theclass "indexrow":attrs) inner - | otherwise = HtmlTag name attrs (setTrClass inner) - f x = x --} - indexInitialLetterLinks = - td << setTrClass (table ! [cellpadding 0, cellspacing 5] << - besides [ td << anchor ! [href (subIndexHtmlFile c)] << - toHtml [c] - | c <- initialChars - , any ((==c) . toUpper . head . fst) index ]) - - -- todo: what about names/operators that start with Unicode - -- characters? - -- Exports beginning with '_' can be listed near the end, - -- presumably they're not as important... but would be listed - -- with non-split index! - initialChars = [ 'A'..'Z' ] ++ ":!#$%&*+./<=>?@\\^|-~" ++ "_" - - do_sub_index this_ix c - = unless (null index_part) $ - writeFile (joinPath [odir, subIndexHtmlFile c]) (renderToString html) - where - html = header (documentCharacterEncoding +++ - thetitle (toHtml (doctitle ++ " (Index)")) +++ - styleSheet) +++ - body << ( - simpleHeader doctitle maybe_contents_url Nothing - maybe_source_url maybe_wiki_url +++ - vanillaTable << ( - indexInitialLetterLinks > - tda [theclass "section1"] << - toHtml ("Index (" ++ c:")") > - td << setTrClass (table ! [identifier "indexlist", cellpadding 0, cellspacing 5] << - aboves (map indexElt index_part) ) - )) - - index_part = [(n,stuff) | (n,stuff) <- this_ix, toUpper (head n) == c] - - - index :: [(String, Map GHC.Name [(Module,Bool)])] - index = sortBy cmp (Map.toAscList full_index) - where cmp (n1,_) (n2,_) = map toUpper n1 `compare` map toUpper n2 - - -- for each name (a plain string), we have a number of original HsNames that - -- it can refer to, and for each of those we have a list of modules - -- that export that entity. Each of the modules exports the entity - -- in a visible or invisible way (hence the Bool). - full_index :: Map String (Map GHC.Name [(Module,Bool)]) - full_index = Map.fromListWith (flip (Map.unionWith (++))) - (concat (map getIfaceIndex ifaces)) - - getIfaceIndex iface = - [ (getOccString name - , Map.fromList [(name, [(mdl, name `elem` instVisibleExports iface)])]) - | name <- instExports iface ] - where mdl = instMod iface - - indexElt :: (String, Map GHC.Name [(Module,Bool)]) -> HtmlTable - indexElt (str, entities) = - case Map.toAscList entities of - [(nm,entries)] -> - tda [ theclass "indexentry" ] << toHtml str <-> - indexLinks nm entries - many_entities -> - tda [ theclass "indexentry" ] << toHtml str > - aboves (map doAnnotatedEntity (zip [1..] many_entities)) - - doAnnotatedEntity :: (Integer, (Name, [(Module, Bool)])) -> HtmlTable - doAnnotatedEntity (j,(nm,entries)) - = tda [ theclass "indexannot" ] << - toHtml (show j) <+> parens (ppAnnot (nameOccName nm)) <-> - indexLinks nm entries hunk ./src/Haddock/Backends/Xhtml.hs 400 - ppAnnot n | not (isValOcc n) = toHtml "Type/Class" - | isDataOcc n = toHtml "Data Constructor" - | otherwise = toHtml "Function" + where + indexPage showLetters ch items = + header (documentCharacterEncoding +++ + thetitle (toHtml (doctitle ++ " (" ++ indexName ch ++ ")")) +++ + styleSheet +++ + (script ! [src jsFile, thetype "text/javascript"] $ noHtml) + ) +++ + body << + (simpleHeader doctitle maybe_contents_url Nothing + maybe_source_url maybe_wiki_url +++ + divIndex << + (sectionName << indexName ch +++ + (if showLetters then indexInitialLetterLinks else noHtml) +++ + (if null items then noHtml else buildIndex items) + ) + ) + + indexName ch = "Index" ++ maybe "" (\c -> " - " ++ [c]) ch + + buildIndex items = table << aboves (map indexElt items) hunk ./src/Haddock/Backends/Xhtml.hs 421 - indexLinks nm entries = - tda [ theclass "indexlinks" ] << - hsep (punctuate comma - [ if visible then - linkId mdl (Just nm) << toHtml (moduleString mdl) - else - toHtml (moduleString mdl) - | (mdl, visible) <- entries ]) + -- an arbitrary heuristic: + -- too large, and a single-page will be slow to load + -- too small, and we'll have lots of letter-indexes with only one + -- or two members in them, which seems inefficient or + -- unnecessarily hard to use. + split_indices = length index > 150 + + indexInitialLetterLinks = + unordList [ anchor ! [href (subIndexHtmlFile c)] << [c] + | c <- initialChars + , any ((==c) . toUpper . head . fst) index ] + + -- todo: what about names/operators that start with Unicode + -- characters? + -- Exports beginning with '_' can be listed near the end, + -- presumably they're not as important... but would be listed + -- with non-split index! + initialChars = [ 'A'..'Z' ] ++ ":!#$%&*+./<=>?@\\^|-~" ++ "_" + + do_sub_index this_ix c + = unless (null index_part) $ + writeFile (joinPath [odir, subIndexHtmlFile c]) (renderToString html) + where + html = indexPage True (Just c) index_part + index_part = [(n,stuff) | (n,stuff) <- this_ix, toUpper (head n) == c] + + + index :: [(String, Map GHC.Name [(Module,Bool)])] + index = sortBy cmp (Map.toAscList full_index) + where cmp (n1,_) (n2,_) = map toUpper n1 `compare` map toUpper n2 + + -- for each name (a plain string), we have a number of original HsNames that + -- it can refer to, and for each of those we have a list of modules + -- that export that entity. Each of the modules exports the entity + -- in a visible or invisible way (hence the Bool). + full_index :: Map String (Map GHC.Name [(Module,Bool)]) + full_index = Map.fromListWith (flip (Map.unionWith (++))) + (concat (map getIfaceIndex ifaces)) + + getIfaceIndex iface = + [ (getOccString name + , Map.fromList [(name, [(mdl, name `elem` instVisibleExports iface)])]) + | name <- instExports iface ] + where mdl = instMod iface + + indexElt :: (String, Map GHC.Name [(Module,Bool)]) -> HtmlTable + indexElt (str, entities) = + case Map.toAscList entities of + [(nm,entries)] -> + td ! [ theclass "src" ] << toHtml str <-> + indexLinks nm entries + many_entities -> + td ! [ theclass "src" ] << toHtml str <-> td << spaceHtml > + aboves (map doAnnotatedEntity (zip [1..] many_entities)) + + doAnnotatedEntity :: (Integer, (Name, [(Module, Bool)])) -> HtmlTable + doAnnotatedEntity (j,(nm,entries)) + = td ! [ theclass "alt" ] << + toHtml (show j) <+> parens (ppAnnot (nameOccName nm)) <-> + indexLinks nm entries + + ppAnnot n | not (isValOcc n) = toHtml "Type/Class" + | isDataOcc n = toHtml "Data Constructor" + | otherwise = toHtml "Function" + + indexLinks nm entries = + td ! [ theclass "module" ] << + hsep (punctuate comma + [ if visible then + linkId mdl (Just nm) << toHtml (moduleString mdl) + else + toHtml (moduleString mdl) + | (mdl, visible) <- entries ]) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 17 - divModuleList, divTableOfContents, + divIndex, divModuleList, divTableOfContents, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 60 -divModuleList, divTableOfContents, - divDescription, divSynposis, divInterface :: Html -> Html +divIndex, divModuleList, divTableOfContents :: Html -> Html +divIndex = thediv ! [identifier "index"] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 64 + +divDescription, divSynposis, divInterface :: Html -> Html hunk ./html/xhaddock.css 197 -#synopsis .caption { +#synopsis .caption, +#module-list .caption { hunk ./html/xhaddock.css 387 -/* @group Original Selectors */ - -/* --------- Contents page ---------- */ hunk ./html/xhaddock.css 388 -div.node { - padding-left: 3em; +#module-list ul { + list-style: none; + margin-left: 10px; + padding-bottom: 15px; hunk ./html/xhaddock.css 394 -div.cnode { - padding-left: 1.75em; +#mini #module-list .caption { + display: none; hunk ./html/xhaddock.css 398 -span.pkg { - position: absolute; - left: 50em; +#index .caption { + display: none; hunk ./html/xhaddock.css 402 -/* --------- Mini Synopsis for Frame View --------- */ +#index .src { + background: none; + font-family: inherit; +} hunk ./html/xhaddock.css 407 -.outer { - margin: 0 0; - padding: 0 0; +#index td.alt { + padding-left: 2em; hunk ./html/xhaddock.css 411 -.mini-synopsis { - padding: 0.25em 0.25em; +#index td { + padding-top: 2px; + padding-bottom: 1px; + padding-right: 1em; hunk ./html/xhaddock.css 417 -.mini-synopsis h1 { font-size: 130%; } -.mini-synopsis h2 { font-size: 110%; } -.mini-synopsis h3 { font-size: 100%; } -.mini-synopsis h1, .mini-synopsis h2, .mini-synopsis h3 { + +#mini h1 { font-size: 130%; } +#mini h2 { font-size: 110%; } +#mini h3 { font-size: 100%; } +#mini h1, #mini h2, #mini h3 { hunk ./html/xhaddock.css 427 -.mini-synopsis h1 { border-bottom: 1px solid #ccc; } +#mini h1 { border-bottom: 1px solid #ccc; } hunk ./html/xhaddock.css 429 -.mini-topbar { +#mini #module-header { + margin: 0; + padding: 0; +} +#mini #module-header .caption { hunk ./html/xhaddock.css 437 + height: inherit; + margin: 0; hunk ./html/xhaddock.css 441 -/* @end */ - +#mini #interface .top { + margin: 0; + padding: 0; +} +#mini #interface .src { + margin: 0; + padding: 0; + font-family: inherit; + background: inherit; +} hunk ./src/Haddock/Backends/Xhtml/Layout.hs 36 - - vanillaTable, vanillaTable2 hunk ./src/Haddock/Backends/Xhtml/Layout.hs 95 +{- + if we ever decide to style sub-declarations with dl lists, this code does it + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 109 +-} hunk ./src/Haddock/Backends/Xhtml/Layout.hs 182 - - --- a vanilla table has width 100%, no border, no padding, no spacing -vanillaTable, vanillaTable2 :: Html -> Html -vanillaTable = table ! [theclass "vanilla", cellspacing 0, cellpadding 0] -vanillaTable2 = table ! [theclass "vanilla2", cellspacing 0, cellpadding 0] hunk ./src/Haddock/Backends/Xhtml/Decl.hs 155 - Nothing -> empty + Nothing -> noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 282 -ppContextNoArrow [] _ = empty +ppContextNoArrow [] _ = noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 287 -ppContextNoLocs [] _ = empty +ppContextNoLocs [] _ = noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 296 -pp_hs_context [] _ = empty +pp_hs_context [] _ = noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 318 - <+> (if not . null . unLoc $ lctxt then ppLContext lctxt unicode else empty) + <+> (if not . null . unLoc $ lctxt then ppLContext lctxt unicode else noHtml) hunk ./src/Haddock/Backends/Xhtml/Decl.hs 447 - | null cons = empty + | null cons = noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 450 - _ -> empty + _ -> noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 523 - Implicit -> empty + Implicit -> noHtml hunk ./src/Haddock/Backends/Xhtml/Decl.hs 611 -ppBang HsNoBang = empty +ppBang HsNoBang = noHtml hunk ./src/Haddock/Backends/Xhtml/Util.hs 19 - (<+>), char, empty, nonEmpty, + (<+>), char, nonEmpty, hunk ./src/Haddock/Backends/Xhtml/Util.hs 25 - tda, emptyTable, s8, - abovesSep, hsep, + hsep, hunk ./src/Haddock/Backends/Xhtml/Util.hs 111 -empty :: Html -empty = noHtml - hunk ./src/Haddock/Backends/Xhtml/Util.hs 134 -abovesSep :: HtmlTable -> [HtmlTable] -> HtmlTable -abovesSep _ [] = emptyTable -abovesSep h (d0:ds) = go d0 ds - where - go d [] = d - go d (e:es) = d > h > go e es - hunk ./src/Haddock/Backends/Xhtml/Util.hs 144 -tda :: [HtmlAttr] -> Html -> HtmlTable -tda as = cell . (td ! as) - -emptyTable :: HtmlTable -emptyTable = cell noHtml - hunk ./src/Haddock/Backends/Xhtml/Util.hs 159 -s8 :: HtmlTable -s8 = tda [ theclass "s8" ] << noHtml - hunk ./src/Haddock/Backends/Xhtml/Util.hs 39 -import qualified Text.XHtml as Html +import qualified Text.XHtml as XHtml hunk ./src/Haddock/Backends/Xhtml/Util.hs 168 -namedAnchor n c = anchor ! [Html.name n] << c +namedAnchor n c = anchor ! [XHtml.name n] << c hunk ./src/Haddock/Backends/Xhtml/Util.hs 214 - (thelink ! [href aFile, rel aRel, thetype "text/css", Html.title aTitle]) noHtml + (thelink ! [href aFile, rel aRel, thetype "text/css", XHtml.title aTitle]) noHtml hunk ./html/haddock-util.js 139 - resetStyle(); // ugly: we are using setSynopsis as a hook! hunk ./src/Haddock/Backends/Xhtml.hs 156 + +headHtml :: String -> Maybe String -> Html +headHtml docTitle miniPage = + header << [ + meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"], + thetitle << docTitle, + styleSheet, + script ! [src jsFile, thetype "text/javascript"] << noHtml, + script ! [thetype "text/javascript"] + -- NB: Within XHTML, the content of script tags needs to be + -- a " in it! + << primHtml ( + "//\n") + ] + where + setSynopsis = maybe "" (\p -> "setSynopsis(\"" ++ p ++ "\");") miniPage + + hunk ./src/Haddock/Backends/Xhtml.hs 288 - header - (documentCharacterEncoding +++ - thetitle (toHtml doctitle) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++ + headHtml doctitle Nothing +++ hunk ./src/Haddock/Backends/Xhtml.hs 373 - header - (documentCharacterEncoding +++ - thetitle (toHtml doctitle) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++ + headHtml doctitle Nothing +++ hunk ./src/Haddock/Backends/Xhtml.hs 414 - header (documentCharacterEncoding +++ - thetitle (toHtml (doctitle ++ " (" ++ indexName ch ++ ")")) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml) - ) +++ + headHtml (doctitle ++ " (" ++ indexName ch ++ ")") Nothing +++ hunk ./src/Haddock/Backends/Xhtml.hs 518 - header (documentCharacterEncoding +++ - thetitle (toHtml mdl_str) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml) +++ - (script ! [thetype "text/javascript"] - -- NB: Within XHTML, the content of script tags needs to be - -- a CDATA section. Will break if the generated name could - -- have "]]>" in it! - << primHtml ( - "//\n") - ) - ) +++ + headHtml mdl_str (Just $ "mini_" ++ moduleHtmlFile mdl) +++ hunk ./src/Haddock/Backends/Xhtml.hs 534 - header - (documentCharacterEncoding +++ - thetitle (toHtml $ moduleString mdl) +++ - styleSheet +++ - (script ! [src jsFile, thetype "text/javascript"] $ noHtml)) +++ + headHtml (moduleString mdl) Nothing +++ hunk ./src/Haddock/Backends/Xhtml/Util.hs 28 - documentCharacterEncoding, hunk ./src/Haddock/Backends/Xhtml/Util.hs 193 -documentCharacterEncoding :: Html -documentCharacterEncoding = - meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"] hunk ./src/Haddock/Backends/Xhtml.hs 216 -simpleHeader :: String -> Maybe String -> Maybe String - -> SourceURLs -> WikiURLs -> Html -simpleHeader doctitle maybe_contents_url maybe_index_url - maybe_source_url maybe_wiki_url = - divPackageHeader << ( - sectionName << nonEmpty doctitle +++ - unordList (catMaybes [ - srcButton maybe_source_url Nothing, - wikiButton maybe_wiki_url Nothing, - contentsButton maybe_contents_url, - indexButton maybe_index_url - ] ++ [styleMenu]) ! [theclass "links"] - ) hunk ./src/Haddock/Backends/Xhtml.hs 217 -pageHeader :: String -> Interface -> String +bodyHtml :: String -> Maybe Interface hunk ./src/Haddock/Backends/Xhtml.hs 219 - -> Maybe String -> Maybe String -> Html -pageHeader mdl iface doctitle + -> Maybe String -> Maybe String + -> Html -> Html +bodyHtml doctitle iface hunk ./src/Haddock/Backends/Xhtml.hs 223 - maybe_contents_url maybe_index_url = - divPackageHeader << ( - sectionName << nonEmpty doctitle +++ - unordList (catMaybes [ - srcButton maybe_source_url (Just iface), - wikiButton maybe_wiki_url (Just $ ifaceMod iface), + maybe_contents_url maybe_index_url + pageContent = + body << [ + divPackageHeader << [ + sectionName << nonEmpty doctitle, + unordList (catMaybes [ + srcButton maybe_source_url iface, + wikiButton maybe_wiki_url (ifaceMod `fmap` iface), hunk ./src/Haddock/Backends/Xhtml.hs 234 - ) +++ - divModuleHeader << ( - sectionName << mdl +++ - moduleInfo iface - ) + ], + pageContent, + footer + ] hunk ./src/Haddock/Backends/Xhtml.hs 278 - body << ( - simpleHeader doctitle Nothing maybe_index_url - maybe_source_url maybe_wiki_url +++ - ppPrologue doctitle prologue +++ - ppModuleTree tree +++ - footer - ) + bodyHtml doctitle Nothing + maybe_source_url maybe_wiki_url + Nothing maybe_index_url << [ + ppPrologue doctitle prologue, + ppModuleTree tree + ] hunk ./src/Haddock/Backends/Xhtml.hs 403 - body << - (simpleHeader doctitle maybe_contents_url Nothing - maybe_source_url maybe_wiki_url +++ - divIndex << + bodyHtml doctitle Nothing + maybe_source_url maybe_wiki_url + maybe_contents_url Nothing << + divIndex << hunk ./src/Haddock/Backends/Xhtml.hs 411 - ) hunk ./src/Haddock/Backends/Xhtml.hs 506 - body << ( - pageHeader mdl_str iface doctitle - maybe_source_url maybe_wiki_url - maybe_contents_url maybe_index_url +++ - ifaceToHtml maybe_source_url maybe_wiki_url iface unicode +++ - footer) + bodyHtml doctitle (Just iface) + maybe_source_url maybe_wiki_url + maybe_contents_url maybe_index_url << [ + divModuleHeader << (sectionName << mdl_str +++ moduleInfo iface), + ifaceToHtml maybe_source_url maybe_wiki_url iface unicode + ] hunk ./src/Haddock/Backends/Xhtml.hs 176 -footer :: Html -footer = - divFooter << paragraph << ( - "Produced by " +++ - (anchor ! [href projectUrl] << toHtml projectName) +++ - (" version " ++ projectVersion) - ) - hunk ./src/Haddock/Backends/Xhtml.hs 228 - footer + divFooter << paragraph << ( + "Produced by " +++ + (anchor ! [href projectUrl] << toHtml projectName) +++ + (" version " ++ projectVersion) + ) hunk ./html/shaddock.css 166 -#synopsis .caption { +#synopsis .caption, +#index .caption, +#module-list .caption { hunk ./html/shaddock.css 176 -h2 { +h2 +{ hunk ./html/shaddock.css 184 -h3 { +h3, +#mini #module-list .caption { hunk ./html/shaddock.css 392 +#index td { + background-color: #f0f0f0; + padding-left: 1em; + padding-right: 1em; +} +#index td.alt { + font-size: 70%; + font-style: italic; + padding-left: 3em; +} + hunk ./html/shaddock.css 405 +body#mini { + width: auto; + padding: 0; + background-color: #ffffff; + color: #000000; + font-size: 90%; + font-family: DroidSerif, Georgia, serif; + margin: 0.5em; +} + +#mini div { + padding: 0 10px; +} hunk ./html/shaddock.css 419 +#module-list ul { + list-style: none; + margin-top: 0.5em; +} hunk ./html/thaddock.css 280 +#index .caption, +#module-list .caption { + font-size:130%; + font-weight:bold; + padding: 0; + top:0; + margin: 0.5em 0; +} + +#index table { + border-spacing: 0; +} +#index td { + padding-right: 1em; + border-top: 1px solid #eaeaea; + padding-top: 2px; + padding-bottom: 2px; +} + +#index td.alt { + padding-left: 2em; + font-style: italic; + font-size: 80%; +} + +.module { +} + +#mini { + padding: 0; + margin: 0 0 0 10px; +} + +#mini h1, #mini h2, #mini h3, #mini h4 { + margin-top: 0.5em; + color: #a9a9a9; +} + +#mini h1 { + background-color: #eff2f9; +} + +#module-list ul { + list-style: none; + margin: 0 0 0 -10px; + padding: 0; +} + +#module-list li { + margin: 0; + border-top: 1px solid #eaeaea; + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; +} + +#mini #interface .top, +#mini #interface .src { + margin-top: 2px; + font-weight: normal; + font-style: normal; +} + +#mini #interface .src a { + font-weight: bold; +} hunk ./html/shaddock.css 392 + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; + font-family: "Gill Sans", "Helvetica Neue","Arial",sans-serif; + font-weight: bold; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + text-decoration: none; +} + hunk ./html/shaddock.css 441 + +#module-list .package { + float: right; +} hunk ./html/thaddock.css 305 +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; +} + +#alphabet li { + display: inline; + margin: 0 0.25em; +} + +#alphabet a { + text-decoration: none; + font-weight: bold; +} + hunk ./html/thaddock.css 340 - margin: 0 0 0 -10px; hunk ./html/thaddock.css 341 + margin: 0; hunk ./html/thaddock.css 347 - padding-top: 2px; - padding-bottom: 2px; - padding-left: 10px; + padding: 2px 0 2px 1.4em; +} + +#module-list li .package { + float: right; hunk ./html/xhaddock.css 198 -#module-list .caption { +#module-list .caption, +#index .caption { hunk ./html/xhaddock.css 391 - margin-left: 10px; hunk ./html/xhaddock.css 392 + padding-left: 2px; + margin: 0; hunk ./html/xhaddock.css 396 +#module-list ul ul { + padding-bottom: 0; + padding-left: 20px; +} + +#module-list li .package { + float: right; +} hunk ./html/xhaddock.css 409 - display: none; +} + +#alphabet ul { + list-style: none; + padding: 0; + margin: 0.5em 0 0; +} + +#alphabet li { + display: inline; + margin: 0 0.2em; hunk ./src/Haddock/Backends/Xhtml.hs 401 - maybe_contents_url Nothing << - divIndex << - (sectionName << indexName ch +++ - (if showLetters then indexInitialLetterLinks else noHtml) +++ - (if null items then noHtml else buildIndex items) - ) + maybe_contents_url Nothing << [ + if showLetters then indexInitialLetterLinks else noHtml, + if null items then noHtml else + divIndex << [sectionName << indexName ch, buildIndex items] + ] hunk ./src/Haddock/Backends/Xhtml.hs 418 - indexInitialLetterLinks = + indexInitialLetterLinks = + divAlphabet << hunk ./src/Haddock/Backends/Xhtml/Layout.hs 17 - divIndex, divModuleList, divTableOfContents, + divIndex, divAlphabet, divModuleList, divTableOfContents, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 58 -divIndex, divModuleList, divTableOfContents :: Html -> Html +divIndex, divAlphabet, divModuleList, divTableOfContents :: Html -> Html hunk ./src/Haddock/Backends/Xhtml/Layout.hs 60 +divAlphabet = thediv ! [identifier "alphabet"] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 17 - divIndex, divAlphabet, divModuleList, divTableOfContents, - divDescription, divSynposis, divInterface, + divTableOfContents, divDescription, divSynposis, divInterface, + divIndex, divAlphabet, divModuleList, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 53 -divPackageHeader, divModuleHeader, divFooter :: Html -> Html -divPackageHeader = thediv ! [identifier "package-header"] -divModuleHeader = thediv ! [identifier "module-header"] -divFooter = thediv ! [identifier "footer"] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 54 -divIndex, divAlphabet, divModuleList, divTableOfContents :: Html -> Html -divIndex = thediv ! [identifier "index"] -divAlphabet = thediv ! [identifier "alphabet"] -divModuleList = thediv ! [identifier "module-list"] -divTableOfContents = thediv ! [identifier "table-of-contents"] +sectionDiv :: String -> Html -> Html +sectionDiv i = thediv ! [identifier i] hunk ./src/Haddock/Backends/Xhtml/Layout.hs 57 -divDescription, divSynposis, divInterface :: Html -> Html -divDescription = thediv ! [identifier "description"] -divSynposis = thediv ! [identifier "synopsis"] -divInterface = thediv ! [identifier "interface"] - --- | The name of a section, used directly after opening a section hunk ./src/Haddock/Backends/Xhtml/Layout.hs 61 +divPackageHeader, divModuleHeader, divFooter, + divTableOfContents, divDescription, divSynposis, divInterface, + divIndex, divAlphabet, divModuleList + :: Html -> Html + +divPackageHeader = sectionDiv "package-header" +divModuleHeader = sectionDiv "module-header" +divFooter = sectionDiv "footer" +divTableOfContents = sectionDiv "table-of-contents" +divDescription = sectionDiv "description" +divSynposis = sectionDiv "synopsis" +divInterface = sectionDiv "interface" +divIndex = sectionDiv "index" +divAlphabet = sectionDiv "alphabet" +divModuleList = sectionDiv "module-list" + + + hunk ./html/shaddock.css 62 -div { +div#content { hunk ./html/shaddock.css 65 - hunk ./html/shaddock.css 66 +div#module-header { + margin: 0 -30px; +} + hunk ./src/Haddock/Backends/Xhtml.hs 227 - pageContent, + divContent << pageContent, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 16 - divPackageHeader, divModuleHeader, divFooter, + divPackageHeader, divContent, divModuleHeader, divFooter, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 61 -divPackageHeader, divModuleHeader, divFooter, +divPackageHeader, divContent, divModuleHeader, divFooter, hunk ./src/Haddock/Backends/Xhtml/Layout.hs 67 +divContent = sectionDiv "content" hunk ./src/Haddock/Backends/Xhtml.hs 297 - divDescription << (h1 << title +++ rdrDocToHtml doc) + docElement divDescription << (h1 << title +++ rdrDocToHtml doc) hunk ./src/Haddock/Backends/Xhtml.hs 546 - sectionName << "Description" +++ docToHtml doc + sectionName << "Description" +++ docSection doc hunk ./src/Haddock/Backends/Xhtml.hs 657 - = nothingIf summary $ docToHtml doc + = nothingIf summary $ docSection doc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 68 - | Map.null argDocs = topDeclElem links loc docname pref1 +++ maybeDocToHtml doc + | Map.null argDocs = topDeclElem links loc docname pref1 +++ maybeDocSection doc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 70 - subArguments (do_args 0 sep typ) +++ maybeDocToHtml doc + subArguments (do_args 0 sep typ) +++ maybeDocSection doc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 163 - | otherwise = header_ +++ maybeDocToHtml mbDoc +++ instancesBit + | otherwise = header_ +++ maybeDocSection mbDoc +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/Decl.hs 203 - | otherwise = header_ +++ maybeDocToHtml mbDoc + | otherwise = header_ +++ maybeDocSection mbDoc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 358 - | otherwise = classheader +++ maybeDocToHtml mbDoc + | otherwise = classheader +++ maybeDocSection mbDoc hunk ./src/Haddock/Backends/Xhtml/Decl.hs 436 - | otherwise = header_ +++ maybeDocToHtml mbDoc +++ constrBit +++ instancesBit + | otherwise = header_ +++ maybeDocSection mbDoc +++ constrBit +++ instancesBit hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 14 - docToHtml, maybeDocToHtml, + docToHtml, hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 16 - origDocToHtml + origDocToHtml, + + docElement, docSection, maybeDocSection, hunk ./src/Haddock/Backends/Xhtml/DocMarkup.hs 90 -maybeDocToHtml :: Maybe (Doc DocName) -> Html -maybeDocToHtml = maybe noHtml docToHtml + + +docElement :: (ADDATTRS a) => a -> a +docElement = (! [theclass "doc"]) + +docSection :: Doc DocName -> Html +docSection = (docElement thediv <<) . docToHtml + +maybeDocSection :: Maybe (Doc DocName) -> Html +maybeDocSection = maybe noHtml docSection + hunk ./src/Haddock/Backends/Xhtml/Layout.hs 112 - ddef << (fmap docToHtml mdoc `with` subs) + docElement ddef << (fmap docToHtml mdoc `with` subs) hunk ./src/Haddock/Backends/Xhtml/Layout.hs 125 - td << nonEmpty (fmap docToHtml mdoc)) + docElement td << nonEmpty (fmap docToHtml mdoc)) hunk ./src/Haddock/Backends/DevHelp.hs 85 - text "(this causes --- ugly extra whitespace with some browsers). -docToHtml :: Doc DocName -> Html -docToHtml doc = markup htmlMarkup (unParagraph (markup htmlCleanup doc)) - -origDocToHtml :: Doc Name -> Html -origDocToHtml doc = markup htmlOrigMarkup (unParagraph (markup htmlCleanup doc)) - -rdrDocToHtml :: Doc RdrName -> Html -rdrDocToHtml doc = markup htmlRdrMarkup (unParagraph (markup htmlCleanup doc)) - --- If there is a single paragraph, then surrounding it with
..
--- can add too much whitespace in some browsers (eg. IE). However if --- we have multiple paragraphs, then we want the extra whitespace to --- separate them. So we catch the single paragraph case and transform it --- here. -unParagraph :: Doc a -> Doc a -unParagraph (DocParagraph d) = d ---NO: This eliminates line breaks in the code block: (SDM, 6/5/2003) ---unParagraph (DocCodeBlock d) = (DocMonospaced d) -unParagraph doc = doc - -htmlCleanup :: DocMarkup a (Doc a) -htmlCleanup = idMarkup { - markupUnorderedList = DocUnorderedList . map unParagraph, - markupOrderedList = DocOrderedList . map unParagraph - } - --- ----------------------------------------------------------------------------- --- * Misc - - -hsep :: [Html] -> Html -hsep [] = noHtml -hsep htmls = foldr1 (\a b -> a+++" "+++b) htmls - -infixr 8 <+>, <++> -(<+>) :: Html -> Html -> Html -a <+> b = Html (getHtmlElements (toHtml a) ++ HtmlString " ": getHtmlElements (toHtml b)) - -(<++>) :: Html -> Html -> Html -a <++> b = a +++ spaceHtml +++ b - -keyword :: String -> Html -keyword s = thespan ! [theclass "keyword"] << toHtml s - -equals, comma :: Html -equals = char '=' -comma = char ',' - -char :: Char -> Html -char c = toHtml [c] - -empty :: Html -empty = noHtml - - -quote :: Html -> Html -quote h = char '`' +++ h +++ '`' - - -parens, brackets, pabrackets, braces :: Html -> Html -parens h = char '(' +++ h +++ char ')' -brackets h = char '[' +++ h +++ char ']' -pabrackets h = toHtml "[:" +++ h +++ toHtml ":]" -braces h = char '{' +++ h +++ char '}' - -punctuate :: Html -> [Html] -> [Html] -punctuate _ [] = [] -punctuate h (d0:ds) = go d0 ds - where - go d [] = [d] - go d (e:es) = (d +++ h) : go e es - -abovesSep :: HtmlTable -> [HtmlTable] -> HtmlTable -abovesSep _ [] = Html.emptyTable -abovesSep h (d0:ds) = go d0 ds - where - go d [] = d - go d (e:es) = d > h > go e es - -parenList :: [Html] -> Html -parenList = parens . hsep . punctuate comma - -ubxParenList :: [Html] -> Html -ubxParenList = ubxparens . hsep . punctuate comma - -ubxparens :: Html -> Html -ubxparens h = toHtml "(#" +++ h +++ toHtml "#)" - -{- -text :: Html -text = strAttr "TEXT" --} - --- a box for displaying code -declBox :: Html -> HtmlTable -declBox html = tda [theclass "decl"] << html - --- a box for top level documented names --- it adds a source and wiki link at the right hand side of the box -topDeclBox :: LinksInfo -> SrcSpan -> DocName -> Html -> HtmlTable -topDeclBox ((_,_,Nothing), (_,_,Nothing)) _ _ html = declBox html -topDeclBox ((_,_,maybe_source_url), (_,_,maybe_wiki_url)) - loc name html = - tda [theclass "topdecl"] << - ( table ! [theclass "declbar"] << - ((tda [theclass "declname"] << html) - <-> srcLink - <-> wikiLink) - ) - where srcLink = - case maybe_source_url of - Nothing -> Html.emptyTable - Just url -> tda [theclass "declbut"] << - let url' = spliceURL (Just fname) (Just origMod) - (Just n) (Just loc) url - in anchor ! [href url'] << toHtml "Source" - - wikiLink = - case maybe_wiki_url of - Nothing -> Html.emptyTable - Just url -> tda [theclass "declbut"] << - let url' = spliceURL (Just fname) (Just mdl) - (Just n) (Just loc) url - in anchor ! [href url'] << toHtml "Comments" - - -- For source links, we want to point to the original module, - -- because only that will have the source. - -- TODO: do something about type instances. They will point to - -- the module defining the type family, which is wrong. - origMod = nameModule n - - -- Name must be documented, otherwise we wouldn't get here - Documented n mdl = name - - fname = unpackFS (srcSpanFile loc) - - --- a box for displaying an 'argument' (some code which has text to the --- right of it). Wrapping is not allowed in these boxes, whereas it is --- in a declBox. -argBox :: Html -> HtmlTable -argBox html = tda [theclass "arg"] << html - --- a box for displaying documentation, --- indented and with a little padding at the top -docBox :: Html -> HtmlTable -docBox html = tda [theclass "doc"] << html - --- a box for displaying documentation, not indented. -ndocBox :: Html -> HtmlTable -ndocBox html = tda [theclass "ndoc"] << html - --- a box for displaying documentation, padded on the left a little -rdocBox :: Html -> HtmlTable -rdocBox html = tda [theclass "rdoc"] << html - -maybeRDocBox :: Maybe (Doc DocName) -> HtmlTable -maybeRDocBox Nothing = rdocBox (noHtml) -maybeRDocBox (Just doc) = rdocBox (docToHtml doc) - --- a box for the buttons at the top of the page -topButBox :: Html -> HtmlTable -topButBox html = tda [theclass "topbut"] << html - -bodyBox :: Html -> HtmlTable -bodyBox html = tda [theclass "body"] << vanillaTable << html - --- a vanilla table has width 100%, no border, no padding, no spacing --- a narrow table is the same but without width 100%. -vanillaTable, vanillaTable2, narrowTable :: Html -> Html -vanillaTable = table ! [theclass "vanilla", cellspacing 0, cellpadding 0] -vanillaTable2 = table ! [theclass "vanilla2", cellspacing 0, cellpadding 0] -narrowTable = table ! [theclass "narrow", cellspacing 0, cellpadding 0] - -spacedTable1, spacedTable5 :: Html -> Html -spacedTable1 = table ! [theclass "vanilla", cellspacing 1, cellpadding 0] -spacedTable5 = table ! [theclass "vanilla", cellspacing 5, cellpadding 0] - -constrHdr, methHdr, atHdr :: HtmlTable -constrHdr = tda [ theclass "section4" ] << toHtml "Constructors" -methHdr = tda [ theclass "section4" ] << toHtml "Methods" -atHdr = tda [ theclass "section4" ] << toHtml "Associated Types" - -instHdr :: String -> HtmlTable -instHdr id_ = - tda [ theclass "section4" ] << (collapsebutton id_ +++ toHtml " Instances") - -dcolon, arrow, darrow, forallSymbol :: Bool -> Html -dcolon unicode = toHtml (if unicode then "∷" else "::") -arrow unicode = toHtml (if unicode then "→" else "->") -darrow unicode = toHtml (if unicode then "⇒" else "=>") -forallSymbol unicode = if unicode then toHtml "∀" else keyword "forall" - - -dot :: Html -dot = toHtml "." - - -s8, s15 :: HtmlTable -s8 = tda [ theclass "s8" ] << noHtml -s15 = tda [ theclass "s15" ] << noHtml - - --- | Generate a named anchor --- --- This actually generates two anchor tags, one with the name unescaped, and one --- with the name URI-escaped. This is needed because Opera 9.52 (and later --- versions) needs the name to be unescaped, while IE 7 needs it to be escaped. --- -namedAnchor :: String -> Html -> Html -namedAnchor n = (anchor ! [Html.name n]) . (anchor ! [Html.name (escapeStr n)]) - - --- --- A section of HTML which is collapsible via a +/- button. --- - --- TODO: Currently the initial state is non-collapsed. Change the 'minusFile' --- below to a 'plusFile' and the 'display:block;' to a 'display:none;' when we --- use cookies from JavaScript to have a more persistent state. - -collapsebutton :: String -> Html -collapsebutton id_ = - image ! [ src minusFile, theclass "coll", onclick ("toggle(this,'" ++ id_ ++ "')"), alt "show/hide" ] - -collapsed :: (HTML a) => (Html -> Html) -> String -> a -> Html -collapsed fn id_ html = - fn ! [identifier id_, thestyle "display:block;"] << html - --- A quote is a valid part of a Haskell identifier, but it would interfere with --- the ECMA script string delimiter used in collapsebutton above. -collapseId :: Name -> String -collapseId nm = "i:" ++ escapeStr (getOccString nm) - -linkedAnchor :: String -> Html -> Html -linkedAnchor frag = anchor ! [href hr_] - where hr_ | null frag = "" - | otherwise = '#': escapeStr frag - -documentCharacterEncoding :: Html -documentCharacterEncoding = - meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"] - -styleSheet :: Html -styleSheet = - thelink ! [href cssFile, rel "stylesheet", thetype "text/css"] rmfile ./src/Haddock/Backends/Html.hs hunk ./src/Haddock/Options.hs 60 - | Flag_Xhtml hunk ./src/Haddock/Options.hs 96 - Option ['h'] ["html"] (NoArg Flag_Html) - "output in HTML", - Option [] ["xhtml"] (NoArg Flag_Xhtml) "use experimental XHTML rendering", + Option ['h'] ["html", "xhtml"] (NoArg Flag_Html) + "output in HTML (XHTML 1.0)", hunk ./src/Haddock/Utils/BlockTable.hs 1 -{- | - - Module : Text.Html.BlockTable - Copyright : (c) Andy Gill, and the Oregon Graduate Institute of - Science and Technology, 1999-2001 - License : BSD-style (see the file libraries/core/LICENSE) - - Maintainer : Andy Gill
| ||||
| ||||
| Documentation | ||||
| data A | ||||
| ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Documentation | ||||
| module A | ||||
| Produced by Haddock version 2.7.2 |
B
module A
| |||||
| |||||
| Synopsis | |||||
| |||||
| Documentation | |||||
| data T | |||||
| |||||
| Produced by Haddock version 2.7.2 |
Bug1
| ||||
| ||||
| Documentation | ||||
| x :: A | ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| foo :: Int | ||||
| /multi-line
+
| ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| foo :: Int | ||||
| don't use apostrophe's in the wrong place's - | ||||
| Produced by Haddock version 2.7.2 |
| ||||||||||||
| ||||||||||||
| Description | ||||||||||||
| Exporting records. - | ||||||||||||
| Synopsis | ||||||||||||
| ||||||||||||
| Documentation | ||||||||||||
| data A | ||||||||||||
| ||||||||||||
| data B | ||||||||||||
| ||||||||||||
| data C | ||||||||||||
| ||||||||||||
| data D | ||||||||||||
| ||||||||||||
| newtype E | ||||||||||||
| ||||||||||||
| Produced by Haddock version 2.7.2 | ||||||||||||
| |||||||
| |||||||
| Description | |||||||
| This module caused a duplicate instance in the documentation for the Foo
+
Bug7 Description This module caused a duplicate instance in the documentation for the Foo hunk ./tests/golden-tests/tests/Bug7.html.ref 6 - | |||||||
| Synopsis | |||||||
| |||||||
| Documentation | |||||||
| data Foo | |||||||
| |||||||
| class Bar x y | |||||||
| |||||||
| Produced by Haddock version 2.7.2 |
| ||||||
| ||||||
| Documentation | ||||||
| data Typ | ||||||
| ||||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Documentation | ||||
| data A a | ||||
| ||||
| Produced by Haddock version 2.7.2 |
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| Synopsis | ||||||||||||||||||||||
| ||||||||||||||||||||||
| Documentation | ||||||||||||||||||||||
| map :: (a -> b) -> [a] -> [b] | ||||||||||||||||||||||
map f xs is the list obtained by applying f to each element - of xs, i.e., - map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn] +
CrossPackageDocs | ||||||||||||||||||||||
| class Monad m where | ||||||||||||||||||||||
| ||||||||||||||||||||||
| runInteractiveProcess | ||||||||||||||||||||||
| ||||||||||||||||||||||
| Produced by Haddock version 2.7.2 | ||||||||||||||||||||||
The Handles are initially in binary mode; if you need them to be
+ in text mode then use hSetBinaryMode.
+
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| fib :: Integer -> Integer | ||||
Fibonacci number of given Integer. - Examples: -
One more Example: -
One more Example: -
Example with an import: -
| ||||
| Produced by Haddock version 2.7.2 |
Examples
| ||||||||||||
| ||||||||||||
| Documentation | ||||||||||||
| f | ||||||||||||
| ||||||||||||
| g | ||||||||||||
| ||||||||||||
| Produced by Haddock version 2.7.2 |
FunArgs
| |||||||||||||||||||
| |||||||||||||||||||
| Synopsis | |||||||||||||||||||
| |||||||||||||||||||
| Documentation | |||||||||||||||||||
| data H1 a b where | |||||||||||||||||||
| |||||||||||||||||||
| Produced by Haddock version 2.7.2 | |||||||||||||||||||
GADTRecords
| |||||||||||
| |||||||||||
| |||||||||||
| Description | |||||||||||
| Implementation of fixed-size hash tables, with a type
+
Hash Description Implementation of fixed-size hash tables, with a type hunk ./tests/golden-tests/tests/Hash.html.ref 9 - | |||||||||||
| Synopsis | |||||||||||
| |||||||||||
| The HashTable type - | |||||||||||
| data HashTable key val | |||||||||||
| |||||||||||
| Operations on HashTables - | |||||||||||
| new :: (Eq key, Hash key) => Int -> IO (HashTable key val) | |||||||||||
| Builds a new hash table with a given size - | |||||||||||
| insert :: (Eq key, Hash key) => key -> val -> IO () | |||||||||||
| Inserts a new element into the hash table - | |||||||||||
| lookup :: Hash key => key -> IO (Maybe val) | |||||||||||
| Looks up a key in the hash table, returns Just val if the key - was found, or Nothing otherwise. - | |||||||||||
| The Hash class - | |||||||||||
| class Hash a where | |||||||||||
| |||||||||||
| Produced by Haddock version 2.7.2 |
HashTable type
+data HashTable key val
A hash table with keys of type key and values of type val.
+ The type key should be an instance of Eq.
+
HashTables
+new :: (Eq key, Hash key) => Int -> IO (HashTable key val)
Builds a new hash table with a given size +
Hash class
+
| ||||
| ||||
| Synopsis | ||||
| Documentation | ||||
| bar - | ||||
| Produced by Haddock version 2.7.2 |
NamedDoc
bar +
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| g :: Int | ||||
| the class C - | ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| f :: a | ||||
| url1 url2 - | ||||
| Produced by Haddock version 2.7.2 |
| ||||||||||||
| ||||||||||||
| Documentation | ||||||||||||
| data Expr | ||||||||||||
| ||||||||||||
| data BinOp | ||||||||||||
| ||||||||||||
| eval :: Expr -> Integer | ||||||||||||
| parseExprExp :: String -> Q Exp | ||||||||||||
| Produced by Haddock version 2.7.2 |
QuasiExpr
| ||||
| ||||
| Documentation | ||||
| val :: Integer | ||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Documentation | ||||
| decl :: Q [Dec] | ||||
| Produced by Haddock version 2.7.2 |
TH
decl :: Q [Dec]
| ||||
| ||||
| Produced by Haddock version 2.7.2 |
TH2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This module illustrates & tests most of the features of Haddock. - Testing references from the description: T, f, g, visible. - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Synopsis | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Type declarations - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data types - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T2 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T3 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T4 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T5 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data T6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N1 a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N2 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N3 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data N4 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N5 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N6 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newtype N7 a b | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Records - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data R | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data R1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test that we can export record selectors on their own: - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Class declarations - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class D a => C a where | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class D a where | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class E a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class F a where | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Test that we can export a class method on its own: - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Function types - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f :: C a => a -> Int | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In a comment string we can refer to identifiers in scope with -single quotes like this: T, and we can refer to modules by -using double quotes: Foo. We can add emphasis like this. -
2. This is the next item (different kind of bullet) - - This is a block of code, which can include other markup: R + | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| g :: Int -> IO CInt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| we can export foreign declarations too - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Auxiliary stuff - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is some documentation that is attached to a name ($aux1) + this is another block of code + We can also include URLs in documentation: http://www.haskell.org/. + Auxiliary stuff +This is some documentation that is attached to a name ($aux1) hunk ./tests/golden-tests/tests/Test.html.ref 86 - code block in named doc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This is some documentation that is attached to a name ($aux2) - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
code block on its own in named doc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
code block on its own in named doc (after newline) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
a nested, named doc comment - with a paragraph, - and a code block | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test +code block in named doc | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ hunk ./tests/golden-tests/tests/Test.html.ref 96 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test3 + test3 hunk ./tests/golden-tests/tests/Test.html.ref 98 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ hunk ./tests/golden-tests/tests/Test.html.ref 101 - test3 + test3 hunk ./tests/golden-tests/tests/Test.html.ref 103 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test3 + test3 hunk ./tests/golden-tests/tests/Test.html.ref 105 - + hunk ./tests/golden-tests/tests/Test.html.ref 108 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
aux11: - test3 + aux11: + test3 hunk ./tests/golden-tests/tests/Test.html.ref 111 - + hunk ./tests/golden-tests/tests/Test.html.ref 114 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
foo - bar - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is some inline documentation in the export list - a code block using bird-tracks + foo + bar + This is some inline documentation in the export list + a code block using bird-tracks hunk ./tests/golden-tests/tests/Test.html.ref 120 - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A hidden module - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hidden :: Int -> Int | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A visible module - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| module Visible | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nested-style doc comments - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Existential / Universal types - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data Ex a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Type signatures with argument docs - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| k | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is a function with documentation for each argument + This function has some arg docs + A foreign import with argument docs + A section +A subsection +a literal line + $ a non literal line $ + | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Produced by Haddock version 2.7.2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| f :: a | ||||
| ...given a raw Addr# to the string, and the length of the string. - | ||||
| Produced by Haddock version 2.7.2 |
Ticket112
| |||||
| |||||
| Documentation | |||||
| class C a where | |||||
| |||||
| Produced by Haddock version 2.7.2 |
| ||||
| ||||
| Synopsis | ||||
| ||||
| Documentation | ||||
| data a :- b | ||||
| ||||
| f :: Int | ||||
| A reference to :- - | ||||
| Produced by Haddock version 2.7.2 |
| |||||||||||||||
| |||||||||||||||
| Synopsis | |||||||||||||||
| |||||||||||||||
| Documentation | |||||||||||||||
| type family G a :: * | |||||||||||||||
| |||||||||||||||
| class A a where | |||||||||||||||
| |||||||||||||||
| type family F a | |||||||||||||||
| |||||||||||||||
| Produced by Haddock version 2.7.2 |
TypeFamilies
| |||||||||||||
| |||||||||||||
| |||||||||||||
| Synopsis | |||||||||||||
| |||||||||||||
| stuff - | |||||||||||||
| data a :-: b | |||||||||||||
| data (a :+: b) c | |||||||||||||
| data Op a b | |||||||||||||
| newtype O g f a | |||||||||||||
| |||||||||||||
| biO :: (g `O` f) a | |||||||||||||
| newtype Flip (~>) b a | |||||||||||||
| |||||||||||||
| Produced by Haddock version 2.7.2 | |||||||||||||
TypeOperators
Contents
| ||||
| ||||
| Documentation | ||||
| visible :: Int -> Int | ||||
| Produced by Haddock version 2.7.2 |
Test
Contents
| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | libraries@haskell.org |
Test
Contents
| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | libraries@haskell.org |
Test
Contents
Test
Contents
Test
Contents
| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | libraries@haskell.org |
Test
Contents
B
module A
B
module A