haddock-api 2.17.3.1 → 2.17.4
raw patch · 9 files changed
+61/−31 lines, 9 filesdep ~Cabaldep ~basedep ~ghcnew-uploader
Dependency ranges changed: Cabal, base, ghc, haddock-library
Files
- haddock-api.cabal +23/−21
- resources/html/Ocean.std-theme/ocean.css +2/−0
- src/Documentation/Haddock.hs +2/−0
- src/Haddock.hs +1/−1
- src/Haddock/Backends/Hyperlinker/Parser.hs +11/−1
- src/Haddock/Backends/Hyperlinker/Types.hs +3/−0
- src/Haddock/Backends/Xhtml.hs +15/−5
- src/Haddock/Backends/Xhtml/Utils.hs +1/−2
- src/Haddock/Convert.hs +3/−1
haddock-api.cabal view
@@ -1,12 +1,12 @@ name: haddock-api-version: 2.17.3.1+version: 2.17.4 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries license: BSD3 license-file: LICENSE author: Simon Marlow, David Waern-maintainer: Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>+maintainer: Alex Biehl <alexbiehl@gmail.com>, Simon Hengel <sol@typeful.net>, Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> homepage: http://www.haskell.org/haddock/ bug-reports: https://github.com/haskell/haddock/issues copyright: (c) Simon Marlow, David Waern@@ -33,28 +33,29 @@ latex/haddock.sty library- default-language:- Haskell2010+ default-language: Haskell2010 - build-depends:- base >= 4.3 && < 4.10- , bytestring- , filepath- , directory- , containers- , transformers- , deepseq- , array- , xhtml >= 3000.2 && < 3000.3- , Cabal >= 1.10- , ghc-boot- , ghc >= 8.0 && < 8.2+ -- this package typically supports only single major versions+ build-depends: base == 4.9.*+ , Cabal == 1.24.*+ , ghc == 8.0.*+ , ghc-paths == 0.1.*+ , haddock-library >= 1.4.2 && < 1.5+ , xhtml == 3000.2.* - , ghc-paths- , haddock-library == 1.4.*+ -- Versions for the dependencies below are transitively pinned by+ -- the non-reinstallable `ghc` package and hence need no version+ -- bounds+ build-depends: array+ , bytestring+ , containers+ , deepseq+ , directory+ , filepath+ , ghc-boot+ , transformers - hs-source-dirs:- src+ hs-source-dirs: src ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 @@ -122,4 +123,5 @@ source-repository head type: git+ subdir: haddock-api location: https://github.com/haskell/haddock.git
resources/html/Ocean.std-theme/ocean.css view
@@ -333,6 +333,8 @@ top: 10%; padding: 0; max-width: 75%;+ /* Ensure that synopsis covers everything (including MathJAX markup) */+ z-index: 1; } #synopsis .caption {
src/Documentation/Haddock.hs view
@@ -16,6 +16,7 @@ -- * Interface Interface(..), InstalledInterface(..),+ toInstalledIface, createInterfaces, processModules, @@ -34,6 +35,7 @@ -- * Documentation comments Doc,+ MDoc, DocH(..), Example(..), Hyperlink(..),
src/Haddock.hs view
@@ -336,7 +336,7 @@ ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir - when (Flag_HyperlinkedSource `elem` flags) $ do+ when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do ppHyperlinkedSource odir libDir opt_source_css pretty srcMap ifaces -- | From GHC 7.10, this function has a potential to crash with a
src/Haddock/Backends/Hyperlinker/Parser.hs view
@@ -31,12 +31,20 @@ chunk str | "--" `isPrefixOf` str = chunk' $ spanToNewline str | "{-" `isPrefixOf` str = chunk' $ chunkComment 0 str- | otherwise = case lex str of+ | otherwise = case lex' str of (tok:_) -> chunk' tok [] -> [str] where chunk' (c, rest) = c:(chunk rest) +-- | A bit better lexer then the default, i.e. handles DataKinds quotes+lex' :: ReadS String+lex' ('\'' : '\'' : rest) = [("''", rest)]+lex' str@('\'' : '\\' : _ : '\'' : _) = lex str+lex' str@('\'' : _ : '\'' : _) = lex str+lex' ('\'' : rest) = [("'", rest)]+lex' str = lex str+ -- | Split input to "first line" string and the rest of it. -- -- Ideally, this should be done simply with @'break' (== '\n')@. However,@@ -124,6 +132,8 @@ | "--" `isPrefixOf` str = TkComment | "{-#" `isPrefixOf` str = TkPragma | "{-" `isPrefixOf` str = TkComment+classify "''" = TkSpecial+classify "'" = TkSpecial classify str@(c:_) | isSpace c = TkSpace | isDigit c = TkNumber
src/Haddock/Backends/Hyperlinker/Types.hs view
@@ -12,16 +12,19 @@ , tkValue :: String , tkSpan :: Span }+ deriving (Show) data Position = Position { posRow :: !Int , posCol :: !Int }+ deriving (Show) data Span = Span { spStart :: Position , spEnd :: Position }+ deriving (Show) data TokenType = TkIdentifier
src/Haddock/Backends/Xhtml.hs view
@@ -35,8 +35,8 @@ import Haddock.GhcUtils import Control.Monad ( when, unless )-import Data.Char ( toUpper )-import Data.List ( sortBy, intercalate, isPrefixOf )+import Data.Char ( toUpper, isSpace )+import Data.List ( sortBy, intercalate, isPrefixOf, intersperse ) import Data.Maybe import System.FilePath hiding ( (</>) ) import System.Directory@@ -172,7 +172,7 @@ maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url pageContent =- body << [+ body ! [theclass "no-frame"] << [ divPackageHeader << [ unordList (catMaybes [ srcButton maybe_source_url iface,@@ -201,8 +201,7 @@ field info >>= \a -> return (th << fieldName <-> td << a) entries :: [HtmlTable]- entries = mapMaybe doOneEntry [- ("Copyright",hmi_copyright),+ entries = maybeToList copyrightsTable ++ mapMaybe doOneEntry [ ("License",hmi_license), ("Maintainer",hmi_maintainer), ("Stability",hmi_stability),@@ -216,6 +215,14 @@ Just Haskell98 -> Just "Haskell98" Just Haskell2010 -> Just "Haskell2010" + multilineRow :: String -> [String] -> HtmlTable+ multilineRow title xs = (th ! [valign "top"]) << title <-> td << (toLines xs)+ where toLines = mconcat . intersperse br . map toHtml++ copyrightsTable :: Maybe HtmlTable+ copyrightsTable = fmap (multilineRow "Copyright" . split) (hmi_copyright info)+ where split = map (trim . filter (/= ',')) . lines+ extsForm | OptShowExtensions `elem` ifaceOptions iface = let fs = map (dropOpt . show) (hmi_extensions info)@@ -648,6 +655,9 @@ processDecl True = Just processDecl False = Just . divTopDecl +trim :: String -> String+trim = f . f+ where f = reverse . dropWhile isSpace processDeclOneLiner :: Bool -> Html -> Maybe Html processDeclOneLiner True = Just
src/Haddock/Backends/Xhtml/Utils.hs view
@@ -75,8 +75,7 @@ case span_ of RealSrcSpan span__ -> show $ srcSpanStartLine span__- UnhelpfulSpan _ ->- error "spliceURL UnhelpfulSpan"+ UnhelpfulSpan _ -> "" run "" = "" run ('%':'M':rest) = mdl ++ run rest
src/Haddock/Convert.hs view
@@ -82,7 +82,7 @@ (map (noLoc . getName) l, map (noLoc . getName) r) ) $ snd $ classTvsFds cl , tcdSigs = noLoc (MinimalSig mempty . noLoc . fmap noLoc $ classMinimalDef cl) :- map (noLoc . synifyIdSig DeleteTopLevelQuantification)+ map (noLoc . synifyTcIdSig DeleteTopLevelQuantification) (classMethods cl) , tcdMeths = emptyBag --ignore default method definitions, they don't affect signature -- class associated-types are a subset of TyCon:@@ -317,6 +317,8 @@ synifyIdSig :: SynifyTypeState -> Id -> Sig Name synifyIdSig s i = TypeSig [synifyName i] (synifySigWcType s (varType i)) +synifyTcIdSig :: SynifyTypeState -> Id -> Sig Name+synifyTcIdSig s i = ClassOpSig False [synifyName i] (synifySigType s (varType i)) synifyCtx :: [PredType] -> LHsContext Name synifyCtx = noLoc . map (synifyType WithinType)