From b383b17cd1c4aebe73481dba0df13640e7bfc50a Mon Sep 17 00:00:00 2001
From: Justus Adam
Date: Thu, 2 Mar 2017 15:33:34 +0100
Subject: Adding MDoc to exports of Documentation.Haddock
---
haddock-api/src/Documentation/Haddock.hs | 1 +
1 file changed, 1 insertion(+)
diff --git a/haddock-api/src/Documentation/Haddock.hs b/haddock-api/src/Documentation/Haddock.hs
index 1ff5cf75..4203a564 100644
--- a/haddock-api/src/Documentation/Haddock.hs
+++ b/haddock-api/src/Documentation/Haddock.hs
@@ -34,6 +34,7 @@ module Documentation.Haddock (
-- * Documentation comments
Doc,
+ MDoc,
DocH(..),
Example(..),
Hyperlink(..),
--
cgit v1.2.3
From ef99ed85007636a866fbdeed154d89612d68f824 Mon Sep 17 00:00:00 2001
From: Justus Adam
Date: Thu, 9 Mar 2017 11:41:44 +0100
Subject: Also exposing toInstalledIface
---
haddock-api/src/Documentation/Haddock.hs | 1 +
1 file changed, 1 insertion(+)
diff --git a/haddock-api/src/Documentation/Haddock.hs b/haddock-api/src/Documentation/Haddock.hs
index 4203a564..14605e92 100644
--- a/haddock-api/src/Documentation/Haddock.hs
+++ b/haddock-api/src/Documentation/Haddock.hs
@@ -16,6 +16,7 @@ module Documentation.Haddock (
-- * Interface
Interface(..),
InstalledInterface(..),
+ toInstalledIface,
createInterfaces,
processModules,
--
cgit v1.2.3
From d2be5e88281d8e3148bc55830c27c75844b86f38 Mon Sep 17 00:00:00 2001
From: Ben Gamari
Date: Thu, 9 Mar 2017 22:13:43 -0500
Subject: Bump for GHC 8.2
---
haddock-api/src/Haddock/InterfaceFile.hs | 4 ++--
haddock.cabal | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index 63419102..0d000029 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -82,8 +82,8 @@ binaryInterfaceMagic = 0xD0Cface
-- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion]
--
binaryInterfaceVersion :: Word16
-#if (__GLASGOW_HASKELL__ >= 801) && (__GLASGOW_HASKELL__ < 803)
-binaryInterfaceVersion = 28
+#if (__GLASGOW_HASKELL__ >= 802) && (__GLASGOW_HASKELL__ < 804)
+binaryInterfaceVersion = 29
binaryInterfaceVersionCompatibility :: [Word16]
binaryInterfaceVersionCompatibility = [binaryInterfaceVersion]
diff --git a/haddock.cabal b/haddock.cabal
index 7103a459..10460526 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -55,8 +55,8 @@ executable haddock
array,
xhtml >= 3000.2 && < 3000.3,
Cabal >= 1.10,
- ghc-boot == 8.1,
- ghc == 8.1,
+ ghc-boot,
+ ghc == 8.2.*,
bytestring,
transformers
--
cgit v1.2.3
From 4f249c9b64d50d79e7ba703289cd67293a76821a Mon Sep 17 00:00:00 2001
From: Richard Eisenberg
Date: Fri, 10 Mar 2017 11:31:33 -0500
Subject: Update Haddock w.r.t. new HsImplicitBndrs
---
haddock-api/src/Haddock/Convert.hs | 5 +++--
haddock-api/src/Haddock/Interface/Rename.hs | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index b5966291..577b1a3c 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -114,7 +114,8 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs })
hs_rhs = synifyType WithinType rhs
in TyFamEqn { tfe_tycon = name
, tfe_pats = HsIB { hsib_body = typats
- , hsib_vars = map tyVarName tkvs }
+ , hsib_vars = map tyVarName tkvs
+ , hsib_closed = True }
, tfe_fixity = Prefix
, tfe_rhs = hs_rhs }
@@ -300,7 +301,7 @@ synifyDataCon use_gadt_syntax dc =
(False,True) -> case linear_tys of
[a,b] -> return $ InfixCon a b
_ -> Left "synifyDataCon: infix with non-2 args?"
- gadt_ty = HsIB [] (synifyType WithinType res_ty)
+ gadt_ty = HsIB [] (synifyType WithinType res_ty) False
-- finally we get synifyDataCon's result!
in hs_arg_tys >>=
\hat ->
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index f88d9f4e..b43860fb 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -577,7 +577,8 @@ renameImplicit :: (in_thing -> RnM out_thing)
renameImplicit rn_thing (HsIB { hsib_body = thing })
= do { thing' <- rn_thing thing
; return (HsIB { hsib_body = thing'
- , hsib_vars = PlaceHolder }) }
+ , hsib_vars = PlaceHolder
+ , hsib_closed = PlaceHolder }) }
renameWc :: (in_thing -> RnM out_thing)
-> HsWildCardBndrs Name in_thing
--
cgit v1.2.3
From f6f9bca1416f6cee48f2d4731a6c38db92e87300 Mon Sep 17 00:00:00 2001
From: Brian Huffman
Date: Fri, 17 Mar 2017 14:57:39 -0700
Subject: Print any user-supplied kind signatures on type parameters.
This applies to type parameters on data, newtype, type, and class
declarations, and also to forall-bound type vars in type signatures.
---
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 37 ++++++++++----------------
1 file changed, 14 insertions(+), 23 deletions(-)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 2aec5272..ffe42c4f 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -171,8 +171,8 @@ ppFixities fs qual = foldr1 (+++) (map ppFix uniq_fs) +++ rightEdge
-- | Pretty-print type variables.
-ppTyVars :: [LHsTyVarBndr DocName] -> [Html]
-ppTyVars tvs = map (ppTyName . getName . hsLTyVarName) tvs
+ppTyVars :: Unicode -> Qualification -> [LHsTyVarBndr DocName] -> [Html]
+ppTyVars unicode qual tvs = map (ppHsTyVarBndr unicode qual . unLoc) tvs
tyvarNames :: LHsQTyVars DocName -> [Name]
tyvarNames = map (getName . hsLTyVarName) . hsQTvExplicit
@@ -199,7 +199,7 @@ ppTySyn summary links fixities loc doc (SynDecl { tcdLName = L _ name, tcdTyVars
splice unicode qual
where
hdr = hsep ([keyword "type", ppBinder summary occ]
- ++ ppTyVars (hsQTvExplicit ltyvars))
+ ++ ppTyVars unicode qual (hsQTvExplicit ltyvars))
full = hdr <+> equals <+> ppLType unicode qual ltype
occ = nameOccName . getName $ name
fixs
@@ -353,20 +353,20 @@ ppAssocType summ links doc (L loc decl) fixities splice unicode qual =
-- | Print a type family and its variables
ppFamDeclBinderWithVars :: Bool -> Unicode -> Qualification -> FamilyDecl DocName -> Html
ppFamDeclBinderWithVars summ unicode qual (FamilyDecl { fdLName = lname, fdTyVars = tvs }) =
- ppAppDocNameTyVarBndrs summ unicode qual (unLoc lname) (map unLoc $ hsq_explicit tvs)
+ ppAppDocNameTyVarBndrs summ unicode qual (unLoc lname) (hsq_explicit tvs)
-- | Print a newtype / data binder and its variables
-ppDataBinderWithVars :: Bool -> TyClDecl DocName -> Html
-ppDataBinderWithVars summ decl =
- ppAppDocNameNames summ (tcdName decl) (tyvarNames $ tcdTyVars decl)
+ppDataBinderWithVars :: Bool -> Unicode -> Qualification -> TyClDecl DocName -> Html
+ppDataBinderWithVars summ unicode qual decl =
+ ppAppDocNameTyVarBndrs summ unicode qual (tcdName decl) (hsQTvExplicit $ tcdTyVars decl)
--------------------------------------------------------------------------------
-- * Type applications
--------------------------------------------------------------------------------
-ppAppDocNameTyVarBndrs :: Bool -> Unicode -> Qualification -> DocName -> [HsTyVarBndr DocName] -> Html
+ppAppDocNameTyVarBndrs :: Bool -> Unicode -> Qualification -> DocName -> [LHsTyVarBndr DocName] -> Html
ppAppDocNameTyVarBndrs summ unicode qual n vs =
- ppTypeApp n [] vs ppDN (ppHsTyVarBndr unicode qual)
+ ppTypeApp n [] vs ppDN (ppHsTyVarBndr unicode qual . unLoc)
where
ppDN notation = ppBinderFixity notation summ . nameOccName . getName
ppBinderFixity Infix = ppBinderInfix
@@ -379,15 +379,6 @@ ppAppNameTypes n ks ts unicode qual =
ppTypeApp n ks ts (\p -> ppDocName qual p True) (ppParendType unicode qual)
--- | Print an application of a 'DocName' and a list of 'Names'
-ppAppDocNameNames :: Bool -> DocName -> [Name] -> Html
-ppAppDocNameNames summ n ns =
- ppTypeApp n [] ns ppDN ppTyName
- where
- ppDN notation = ppBinderFixity notation summ . nameOccName . getName
- ppBinderFixity Infix = ppBinderInfix
- ppBinderFixity _ = ppBinder
-
-- | General printing of type applications
ppTypeApp :: DocName -> [a] -> [a] -> (Notation -> DocName -> Html) -> (a -> Html) -> Html
ppTypeApp n [] (t1:t2:rest) ppDN ppT
@@ -445,7 +436,7 @@ ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName
ppClassHdr summ lctxt n tvs fds unicode qual =
keyword "class"
<+> (if not . null . unLoc $ lctxt then ppLContext lctxt unicode qual else noHtml)
- <+> ppAppDocNameNames summ n (tyvarNames tvs)
+ <+> ppAppDocNameTyVarBndrs summ unicode qual n (hsQTvExplicit tvs)
<+> ppFds fds unicode qual
@@ -890,7 +881,7 @@ ppDataHeader summary decl@(DataDecl { tcdDataDefn =
-- context
ppLContext ctxt unicode qual <+>
-- T a b c ..., or a :+: b
- ppDataBinderWithVars summary decl
+ ppDataBinderWithVars summary unicode qual decl
<+> case ks of
Nothing -> mempty
Just (L _ x) -> dcolon unicode <+> ppKind unicode qual x
@@ -967,8 +958,8 @@ ppLKind unicode qual y = ppKind unicode qual (unLoc y)
ppKind :: Unicode -> Qualification -> HsKind DocName -> Html
ppKind unicode qual ki = ppr_mono_ty pREC_TOP ki unicode qual
-ppForAllPart :: [LHsTyVarBndr DocName] -> Unicode -> Html
-ppForAllPart tvs unicode = hsep (forallSymbol unicode : ppTyVars tvs) +++ dot
+ppForAllPart :: Unicode -> Qualification -> [LHsTyVarBndr DocName] -> Html
+ppForAllPart unicode qual tvs = hsep (forallSymbol unicode : ppTyVars unicode qual tvs) +++ dot
ppr_mono_lty :: Int -> LHsType DocName -> Unicode -> Qualification -> Html
ppr_mono_lty ctxt_prec ty = ppr_mono_ty ctxt_prec (unLoc ty)
@@ -977,7 +968,7 @@ ppr_mono_lty ctxt_prec ty = ppr_mono_ty ctxt_prec (unLoc ty)
ppr_mono_ty :: Int -> HsType DocName -> Unicode -> Qualification -> Html
ppr_mono_ty ctxt_prec (HsForAllTy tvs ty) unicode qual
= maybeParen ctxt_prec pREC_FUN $
- ppForAllPart tvs unicode <+> ppr_mono_lty pREC_TOP ty unicode qual
+ ppForAllPart unicode qual tvs <+> ppr_mono_lty pREC_TOP ty unicode qual
ppr_mono_ty ctxt_prec (HsQualTy ctxt ty) unicode qual
= maybeParen ctxt_prec pREC_FUN $
--
cgit v1.2.3
From 29c76f761fe131cc00272eed9a0137953dba6180 Mon Sep 17 00:00:00 2001
From: Brian Huffman
Date: Fri, 17 Mar 2017 15:10:40 -0700
Subject: Update test suite to expect kind annotations on type parameters.
---
html-test/ref/SpuriousSuperclassConstraints.html | 6 +++++-
html-test/ref/TypeFamilies.html | 8 ++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/html-test/ref/SpuriousSuperclassConstraints.html b/html-test/ref/SpuriousSuperclassConstraints.html
index b5aa56b3..e73ef2ac 100644
--- a/html-test/ref/SpuriousSuperclassConstraints.html
+++ b/html-test/ref/SpuriousSuperclassConstraints.html
@@ -77,7 +77,11 @@ Fix spurious superclass constraints bug.data SomeType f a (f :: * -> *) a #
class a (a :: k) >< b (b :: k) #
Date: Thu, 23 Mar 2017 17:49:32 +0100
Subject: Include travis build indication badge
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 160ee995..23d0dd0b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Haddock, a Haskell Documentation Tool
+# Haddock, a Haskell Documentation Tool [](https://travis-ci.org/haskell/haddock)
#### About haddock
--
cgit v1.2.3
From ee3e3d03ce17238fb81a2ec83880167335d516e9 Mon Sep 17 00:00:00 2001
From: Ben Gamari
Date: Thu, 23 Mar 2017 09:27:28 -0400
Subject: haddock-api: Bump bound on GHC
---
haddock-api/haddock-api.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 620fd981..922aa07c 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -48,7 +48,7 @@ library
, xhtml >= 3000.2 && < 3000.3
, Cabal >= 1.10
, ghc-boot
- , ghc >= 8.0 && < 8.2
+ , ghc == 8.2.*
, ghc-paths
, haddock-library == 1.4.*
--
cgit v1.2.3
From 68e531baa35e698d947686b83525871eb33c3730 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 02:53:36 -0700
Subject: Correctly handle Backpack identity/semantic modules.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737)
---
haddock-api/src/Haddock/Interface/Create.hs | 75 +++++++++++++++++++++--------
1 file changed, 54 insertions(+), 21 deletions(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index c8e6b982..ff53fd3c 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -62,6 +62,7 @@ createInterface tm flags modMap instIfaceMap = do
L _ hsm = parsedSource tm
!safety = modInfoSafe mi
mdl = ms_mod ms
+ sem_mdl = tcg_semantic_mod (fst (tm_internals_ tm))
dflags = ms_hspp_opts ms
!instances = modInfoInstances mi
!fam_instances = md_fam_insts md
@@ -88,8 +89,9 @@ createInterface tm flags modMap instIfaceMap = do
let declsWithDocs = topDecls group_
fixMap = mkFixMap group_
(decls, _) = unzip declsWithDocs
- localInsts = filter (nameIsLocalOrFrom mdl) $ map getName instances
- ++ map getName fam_instances
+ localInsts = filter (nameIsLocalOrFrom sem_mdl)
+ $ map getName instances
+ ++ map getName fam_instances
-- Locations of all TH splices
splices = [ l | L l (SpliceD _) <- hsmodDecls hsm ]
@@ -104,7 +106,7 @@ createInterface tm flags modMap instIfaceMap = do
let allWarnings = M.unions (warningMap : map ifaceWarningMap (M.elems modMap))
- exportItems <- mkExportItems modMap mdl allWarnings gre exportedNames decls
+ exportItems <- mkExportItems modMap mdl sem_mdl allWarnings gre exportedNames decls
maps fixMap splices exports instIfaceMap dflags
let !visibleNames = mkVisibleNames maps exportItems opts
@@ -156,6 +158,10 @@ createInterface tm flags modMap instIfaceMap = do
, ifaceTokenizedSrc = tokenizedSrc
}
+-- | Given all of the @import M as N@ declarations in a package,
+-- create a mapping from the module identity of M, to an alias N
+-- (if there are multiple aliases, we pick the last one.) This
+-- will go in 'ifaceModuleAliases'.
mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName
mkAliasMap dflags mRenamedSource =
case mRenamedSource of
@@ -166,13 +172,28 @@ mkAliasMap dflags mRenamedSource =
SrcLoc.L _ alias <- ideclAs impDecl
return $
(lookupModuleDyn dflags
+ -- TODO: This is supremely dodgy, because in general the
+ -- UnitId isn't going to look anything like the package
+ -- qualifier (even with old versions of GHC, the
+ -- IPID would be p-0.1, but a package qualifier never
+ -- has a version number it. (Is it possible that in
+ -- Haddock-land, the UnitIds never have version numbers?
+ -- I, ezyang, have not quite understand Haddock's package
+ -- identifier model.)
+ --
+ -- Additionally, this is simulating some logic GHC already
+ -- has for deciding how to qualify names when it outputs
+ -- them to the user. We should reuse that information;
+ -- or at least reuse the renamed imports, which know what
+ -- they import!
(fmap Module.fsToUnitId $
fmap sl_fs $ ideclPkgQual impDecl)
(case ideclName impDecl of SrcLoc.L _ name -> name),
alias))
impDecls
--- similar to GHC.lookupModule
+-- Similar to GHC.lookupModule
+-- ezyang: Not really...
lookupModuleDyn ::
DynFlags -> Maybe UnitId -> ModuleName -> Module
lookupModuleDyn _ (Just pkgId) mdlName =
@@ -492,6 +513,7 @@ collectDocs = go Nothing []
mkExportItems
:: IfaceMap
-> Module -- this module
+ -> Module -- semantic module
-> WarningMap
-> GlobalRdrEnv
-> [Name] -- exported names (orig)
@@ -504,7 +526,7 @@ mkExportItems
-> DynFlags
-> ErrMsgGhc [ExportItem Name]
mkExportItems
- modMap thisMod warnings gre exportedNames decls
+ modMap thisMod semMod warnings gre exportedNames decls
maps@(docMap, argMap, subMap, declMap, instMap) fixMap splices optExports instIfaceMap dflags =
case optExports of
Nothing -> fullModuleContents dflags warnings gre maps fixMap splices decls
@@ -515,6 +537,7 @@ mkExportItems
lookupExport (IEThingAll (L _ t)) = declWith $ ieWrappedName t
lookupExport (IEThingWith (L _ t) _ _ _) = declWith $ ieWrappedName t
lookupExport (IEModuleContents (L _ m)) =
+ -- Pass in identity module, so we can look it up in index correctly
moduleExports thisMod m dflags warnings gre exportedNames decls modMap instIfaceMap maps fixMap splices
lookupExport (IEGroup lev docStr) = return $
return . ExportGroup lev "" $ processDocString dflags gre docStr
@@ -582,6 +605,8 @@ mkExportItems
Just decl ->
-- We try to get the subs and docs
-- from the installed .haddock file for that package.
+ -- TODO: This needs to be more sophisticated to deal
+ -- with signature inheritance
case M.lookup (nameModule t) instIfaceMap of
Nothing -> do
liftErrMsg $ tell
@@ -597,8 +622,7 @@ mkExportItems
mkExportDecl :: Name -> LHsDecl Name -> (DocForDecl Name, [(Name, DocForDecl Name)]) -> ExportItem Name
mkExportDecl name decl (doc, subs) = decl'
where
- decl' = ExportDecl (restrictTo sub_names (extractDecl name mdl decl)) doc subs' [] fixities False
- mdl = nameModule name
+ decl' = ExportDecl (restrictTo sub_names (extractDecl name decl)) doc subs' [] fixities False
subs' = filter (isExported . fst) subs
sub_names = map fst subs'
fixities = [ (n, f) | n <- name:sub_names, Just f <- [M.lookup n fixMap] ]
@@ -609,14 +633,20 @@ mkExportItems
findDecl :: Name -> ([LHsDecl Name], (DocForDecl Name, [(Name, DocForDecl Name)]))
findDecl n
- | m == thisMod, Just ds <- M.lookup n declMap =
+ | m == semMod, Just ds <- M.lookup n declMap =
(ds, lookupDocs n warnings docMap argMap subMap)
- | Just iface <- M.lookup m modMap, Just ds <- M.lookup n (ifaceDeclMap iface) =
+ | Just iface <- M.lookup (semToIdMod (moduleUnitId thisMod) m) modMap, Just ds <- M.lookup n (ifaceDeclMap iface) =
(ds, lookupDocs n warnings (ifaceDocMap iface) (ifaceArgMap iface) (ifaceSubMap iface))
| otherwise = ([], (noDocForDecl, []))
where
m = nameModule n
+-- | Given a 'Module' from a 'Name', convert it into a 'Module' that
+-- we can actually find in the 'IfaceMap'.
+semToIdMod :: UnitId -> Module -> Module
+semToIdMod this_uid m
+ | Module.isHoleModule m = mkModule this_uid (moduleName m)
+ | otherwise = m
hiDecl :: DynFlags -> Name -> ErrMsgGhc (Maybe (LHsDecl Name))
hiDecl dflags t = do
@@ -679,7 +709,7 @@ lookupDocs n warnings docMap argMap subMap =
-- only return those that are.
-- 3) B is visible and all its exports are in scope, in which case we return
-- a single 'ExportModule' item.
-moduleExports :: Module -- ^ Module A
+moduleExports :: Module -- ^ Module A (identity, NOT semantic)
-> ModuleName -- ^ The real name of B, the exported module
-> DynFlags -- ^ The flags used when typechecking A
-> WarningMap
@@ -693,8 +723,11 @@ moduleExports :: Module -- ^ Module A
-> [SrcSpan] -- ^ Locations of all TH splices
-> ErrMsgGhc [ExportItem Name] -- ^ Resulting export items
moduleExports thisMod expMod dflags warnings gre _exports decls ifaceMap instIfaceMap maps fixMap splices
- | m == thisMod = fullModuleContents dflags warnings gre maps fixMap splices decls
+ | expMod == moduleName thisMod
+ = fullModuleContents dflags warnings gre maps fixMap splices decls
| otherwise =
+ -- NB: we constructed the identity module when looking up in
+ -- the IfaceMap.
case M.lookup m ifaceMap of
Just iface
| OptHide `elem` ifaceOptions iface -> return (ifaceExportItems iface)
@@ -710,7 +743,7 @@ moduleExports thisMod expMod dflags warnings gre _exports decls ifaceMap instIfa
"documentation for exported module: " ++ pretty dflags expMod]
return []
where
- m = mkModule unitId expMod
+ m = mkModule unitId expMod -- Identity module!
unitId = moduleUnitId thisMod
@@ -789,8 +822,8 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap
-- it might be an individual record selector or a class method. In these
-- cases we have to extract the required declaration (and somehow cobble
-- together a type signature for it...).
-extractDecl :: Name -> Module -> LHsDecl Name -> LHsDecl Name
-extractDecl name mdl decl
+extractDecl :: Name -> LHsDecl Name -> LHsDecl Name
+extractDecl name decl
| name `elem` getMainDeclBinder (unLoc decl) = decl
| otherwise =
case unLoc decl of
@@ -812,11 +845,11 @@ extractDecl name mdl decl
O.$$ O.nest 4 (O.ppr matches))
TyClD d@DataDecl {} ->
let (n, tyvar_tys) = (tcdName d, lHsQTyVarsToTypes (tyClDeclTyVars d))
- in SigD <$> extractRecSel name mdl n tyvar_tys (dd_cons (tcdDataDefn d))
+ in SigD <$> extractRecSel name n tyvar_tys (dd_cons (tcdDataDefn d))
InstD (DataFamInstD DataFamInstDecl { dfid_tycon = L _ n
, dfid_pats = HsIB { hsib_body = tys }
, dfid_defn = defn }) ->
- SigD <$> extractRecSel name mdl n tys (dd_cons defn)
+ SigD <$> extractRecSel name n tys (dd_cons defn)
InstD (ClsInstD ClsInstDecl { cid_datafam_insts = insts }) ->
let matches = [ d | L _ d <- insts
-- , L _ ConDecl { con_details = RecCon rec } <- dd_cons (dfid_defn d)
@@ -826,19 +859,19 @@ extractDecl name mdl decl
, selectorFieldOcc n == name
]
in case matches of
- [d0] -> extractDecl name mdl (noLoc . InstD $ DataFamInstD d0)
+ [d0] -> extractDecl name (noLoc . InstD $ DataFamInstD d0)
_ -> error "internal: extractDecl (ClsInstD)"
_ -> error "internal: extractDecl"
-extractRecSel :: Name -> Module -> Name -> [LHsType Name] -> [LConDecl Name]
+extractRecSel :: Name -> Name -> [LHsType Name] -> [LConDecl Name]
-> LSig Name
-extractRecSel _ _ _ _ [] = error "extractRecSel: selector not found"
+extractRecSel _ _ _ [] = error "extractRecSel: selector not found"
-extractRecSel nm mdl t tvs (L _ con : rest) =
+extractRecSel nm t tvs (L _ con : rest) =
case getConDetails con of
RecCon (L _ fields) | ((l,L _ (ConDeclField _nn ty _)) : _) <- matching_fields fields ->
L l (TypeSig [noLoc nm] (mkEmptySigWcType (noLoc (HsFunTy data_ty (getBangType ty)))))
- _ -> extractRecSel nm mdl t tvs rest
+ _ -> extractRecSel nm t tvs rest
where
matching_fields :: [LConDeclField Name] -> [(SrcSpan, LConDeclField Name)]
matching_fields flds = [ (l,f) | f@(L _ (ConDeclField ns _ _)) <- flds
--
cgit v1.2.3
From 26879d9b4a2aba264a10812f2738d4db685d61d1 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 03:03:20 -0700
Subject: Add a field marking if interface is a signature or not.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858)
---
haddock-api/src/Haddock/Interface/Create.hs | 1 +
haddock-api/src/Haddock/InterfaceFile.hs | 6 ++++--
haddock-api/src/Haddock/Types.hs | 7 +++++++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index ff53fd3c..024cd02d 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -132,6 +132,7 @@ createInterface tm flags modMap instIfaceMap = do
return $! Interface {
ifaceMod = mdl
+ , ifaceIsSig = Module.isHoleModule sem_mdl
, ifaceOrigFilename = msHsFilePath ms
, ifaceInfo = info
, ifaceDoc = Documentation mbDoc modWarn
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index 0d000029..78853a79 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -372,9 +372,10 @@ instance Binary InterfaceFile where
instance Binary InstalledInterface where
- put_ bh (InstalledInterface modu info docMap argMap
+ put_ bh (InstalledInterface modu is_sig info docMap argMap
exps visExps opts subMap fixMap) = do
put_ bh modu
+ put_ bh is_sig
put_ bh info
put_ bh docMap
put_ bh argMap
@@ -386,6 +387,7 @@ instance Binary InstalledInterface where
get bh = do
modu <- get bh
+ is_sig <- get bh
info <- get bh
docMap <- get bh
argMap <- get bh
@@ -395,7 +397,7 @@ instance Binary InstalledInterface where
subMap <- get bh
fixMap <- get bh
- return (InstalledInterface modu info docMap argMap
+ return (InstalledInterface modu is_sig info docMap argMap
exps visExps opts subMap fixMap)
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index 8addfa2f..a6dd6354 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -80,6 +80,9 @@ data Interface = Interface
-- | The module behind this interface.
ifaceMod :: !Module
+ -- | Is this a signature?
+ , ifaceIsSig :: !Bool
+
-- | Original file name of the module.
, ifaceOrigFilename :: !FilePath
@@ -157,6 +160,9 @@ data InstalledInterface = InstalledInterface
-- | The module represented by this interface.
instMod :: Module
+ -- | Is this a signature?
+ , instIsSig :: Bool
+
-- | Textual information about the module.
, instInfo :: HaddockModInfo Name
@@ -186,6 +192,7 @@ data InstalledInterface = InstalledInterface
toInstalledIface :: Interface -> InstalledInterface
toInstalledIface interface = InstalledInterface
{ instMod = ifaceMod interface
+ , instIsSig = ifaceIsSig interface
, instInfo = ifaceInfo interface
, instDocMap = ifaceDocMap interface
, instArgMap = ifaceArgMap interface
--
cgit v1.2.3
From fbbe544c91020da143160bb8c68ee890d214a69e Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 03:13:10 -0700
Subject: Render signature module tree separately from modules.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0)
---
haddock-api/src/Haddock/Backends/Xhtml.hs | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 65b427f9..34911b11 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -263,13 +263,20 @@ ppHtmlContents dflags odir doctitle _maybe_package
themes mathjax_url maybe_index_url
maybe_source_url maybe_wiki_url ifaces showPkgs prologue debug qual = do
let tree = mkModuleTree dflags showPkgs
- [(instMod iface, toInstalledDescription iface) | iface <- ifaces]
+ [(instMod iface, toInstalledDescription iface)
+ | iface <- ifaces
+ , not (instIsSig iface)]
+ sig_tree = mkModuleTree dflags showPkgs
+ [(instMod iface, toInstalledDescription iface)
+ | iface <- ifaces
+ , instIsSig iface]
html =
headHtml doctitle Nothing themes mathjax_url +++
bodyHtml doctitle Nothing
maybe_source_url maybe_wiki_url
Nothing maybe_index_url << [
ppPrologue qual doctitle prologue,
+ ppSignatureTree qual sig_tree,
ppModuleTree qual tree
]
createDirectoryIfMissing True odir
@@ -282,7 +289,13 @@ ppPrologue qual title (Just doc) =
divDescription << (h1 << title +++ docElement thediv (rdrDocToHtml qual doc))
+ppSignatureTree :: Qualification -> [ModuleTree] -> Html
+ppSignatureTree qual ts =
+ divModuleList << (sectionName << "Signatures" +++ mkNodeList qual [] "n" ts)
+
+
ppModuleTree :: Qualification -> [ModuleTree] -> Html
+ppModuleTree _ [] = mempty
ppModuleTree qual ts =
divModuleList << (sectionName << "Modules" +++ mkNodeList qual [] "n" ts)
--
cgit v1.2.3
From 4e6f4447caf61b6a91a483f30a15354cbf6cfc31 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 15:13:27 -0700
Subject: Documentation.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc)
---
haddock-api/src/Haddock/Interface/Create.hs | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 024cd02d..502d6599 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -11,6 +11,10 @@
-- Maintainer : haddock@projects.haskell.org
-- Stability : experimental
-- Portability : portable
+--
+-- This module provides a single function 'createInterface',
+-- which creates a Haddock 'Interface' from the typechecking
+-- results 'TypecheckedModule' from GHC.
-----------------------------------------------------------------------------
module Haddock.Interface.Create (createInterface) where
@@ -54,7 +58,11 @@ import HsDecls ( getConDetails )
-- | Use a 'TypecheckedModule' to produce an 'Interface'.
-- To do this, we need access to already processed modules in the topological
-- sort. That's what's in the 'IfaceMap'.
-createInterface :: TypecheckedModule -> [Flag] -> IfaceMap -> InstIfaceMap -> ErrMsgGhc Interface
+createInterface :: TypecheckedModule
+ -> [Flag] -- Boolean flags
+ -> IfaceMap -- Locally processed modules
+ -> InstIfaceMap -- External, already installed interfaces
+ -> ErrMsgGhc Interface
createInterface tm flags modMap instIfaceMap = do
let ms = pm_mod_summary . tm_parsed_module $ tm
@@ -518,7 +526,7 @@ mkExportItems
-> WarningMap
-> GlobalRdrEnv
-> [Name] -- exported names (orig)
- -> [LHsDecl Name]
+ -> [LHsDecl Name] -- renamed source declarations
-> Maps
-> FixMap
-> [SrcSpan] -- splice locations
@@ -716,7 +724,7 @@ moduleExports :: Module -- ^ Module A (identity, NOT semantic)
-> WarningMap
-> GlobalRdrEnv -- ^ The renaming environment used for A
-> [Name] -- ^ All the exports of A
- -> [LHsDecl Name] -- ^ All the declarations in A
+ -> [LHsDecl Name] -- ^ All the renamed declarations in A
-> IfaceMap -- ^ Already created interfaces
-> InstIfaceMap -- ^ Interfaces in other packages
-> Maps
@@ -765,8 +773,17 @@ moduleExports thisMod expMod dflags warnings gre _exports decls ifaceMap instIfa
-- (For more information, see Trac #69)
-fullModuleContents :: DynFlags -> WarningMap -> GlobalRdrEnv -> Maps -> FixMap -> [SrcSpan]
- -> [LHsDecl Name] -> ErrMsgGhc [ExportItem Name]
+-- | Simplified variant of 'mkExportItems', where we can assume that
+-- every locally defined declaration is exported; thus, we just
+-- zip through the renamed declarations.
+fullModuleContents :: DynFlags
+ -> WarningMap
+ -> GlobalRdrEnv -- ^ The renaming environment
+ -> Maps
+ -> FixMap
+ -> [SrcSpan] -- ^ Locations of all TH splices
+ -> [LHsDecl Name] -- ^ All the renamed declarations
+ -> ErrMsgGhc [ExportItem Name]
fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap) fixMap splices decls =
liftM catMaybes $ mapM mkExportItem (expandSig decls)
where
--
cgit v1.2.3
From f65966b2febe36c8aae8ebee13d3f12a63479e65 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 15:25:09 -0700
Subject: More docs.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a)
---
haddock-api/src/Haddock/Interface/Create.hs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 502d6599..f1043c03 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -92,6 +92,7 @@ createInterface tm flags modMap instIfaceMap = do
| Flag_IgnoreAllExports `elem` flags = OptIgnoreExports : opts0
| otherwise = opts0
+ -- Process the top-level module header documentation.
(!info, mbDoc) <- liftErrMsg $ processModuleHeader dflags gre safety mayDocHeader
let declsWithDocs = topDecls group_
@@ -114,6 +115,8 @@ createInterface tm flags modMap instIfaceMap = do
let allWarnings = M.unions (warningMap : map ifaceWarningMap (M.elems modMap))
+ -- The MAIN functionality: compute the export items which will
+ -- each be the actual documentation of this module.
exportItems <- mkExportItems modMap mdl sem_mdl allWarnings gre exportedNames decls
maps fixMap splices exports instIfaceMap dflags
@@ -352,6 +355,8 @@ mkMaps dflags gre instances decls =
-- | Get all subordinate declarations inside a declaration, and their docs.
+-- A subordinate declaration is something like the associate type or data
+-- family of a type class.
subordinates :: InstMap -> HsDecl Name -> [(Name, [HsDocString], Map Int HsDocString)]
subordinates instMap decl = case decl of
InstD (ClsInstD d) -> do
--
cgit v1.2.3
From 76d0b2b8ac2bfaa7983a9b5ea828f6caf8a6205d Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Mon, 13 Mar 2017 15:33:25 -0700
Subject: TODO on moduleExports.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e)
---
haddock-api/src/Haddock/Interface/Create.hs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index f1043c03..85401bfa 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -551,7 +551,11 @@ mkExportItems
lookupExport (IEThingAll (L _ t)) = declWith $ ieWrappedName t
lookupExport (IEThingWith (L _ t) _ _ _) = declWith $ ieWrappedName t
lookupExport (IEModuleContents (L _ m)) =
- -- Pass in identity module, so we can look it up in index correctly
+ -- TODO: We could get more accurate reporting here if IEModuleContents
+ -- also recorded the actual names that are exported here. We CAN
+ -- compute this info using @gre@ but 'moduleExports does not seem to
+ -- do so.
+ -- NB: Pass in identity module, so we can look it up in index correctly
moduleExports thisMod m dflags warnings gre exportedNames decls modMap instIfaceMap maps fixMap splices
lookupExport (IEGroup lev docStr) = return $
return . ExportGroup lev "" $ processDocString dflags gre docStr
--
cgit v1.2.3
From 24694932de26645331eb53b016c84a6a5c171a97 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Tue, 14 Mar 2017 03:53:49 -0700
Subject: Better Backpack support with signature merging.
When we merge signatures, we gain exports that don't
necessarily have a source-level declaration corresponding
to them. This meant Haddock dropped them.
There are two big limitations:
* If there's no export list, we won't report inherited
signatures.
* If the type has a subordinate, the current hiDecl
implementation doesn't reconstitute them.
These are probably worth fixing eventually, but this gets
us to minimum viable functionality.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3)
---
haddock-api/src/Haddock/Interface/Create.hs | 46 +++++++++++++++++++++--------
1 file changed, 34 insertions(+), 12 deletions(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 85401bfa..e594feae 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -71,6 +71,7 @@ createInterface tm flags modMap instIfaceMap = do
!safety = modInfoSafe mi
mdl = ms_mod ms
sem_mdl = tcg_semantic_mod (fst (tm_internals_ tm))
+ is_sig = ms_hsc_src ms == HsigFile
dflags = ms_hspp_opts ms
!instances = modInfoInstances mi
!fam_instances = md_fam_insts md
@@ -117,7 +118,7 @@ createInterface tm flags modMap instIfaceMap = do
-- The MAIN functionality: compute the export items which will
-- each be the actual documentation of this module.
- exportItems <- mkExportItems modMap mdl sem_mdl allWarnings gre exportedNames decls
+ exportItems <- mkExportItems is_sig modMap mdl sem_mdl allWarnings gre exportedNames decls
maps fixMap splices exports instIfaceMap dflags
let !visibleNames = mkVisibleNames maps exportItems opts
@@ -143,7 +144,7 @@ createInterface tm flags modMap instIfaceMap = do
return $! Interface {
ifaceMod = mdl
- , ifaceIsSig = Module.isHoleModule sem_mdl
+ , ifaceIsSig = is_sig
, ifaceOrigFilename = msHsFilePath ms
, ifaceInfo = info
, ifaceDoc = Documentation mbDoc modWarn
@@ -525,7 +526,8 @@ collectDocs = go Nothing []
-- We create the export items even if the module is hidden, since they
-- might be useful when creating the export items for other modules.
mkExportItems
- :: IfaceMap
+ :: Bool -- is it a signature
+ -> IfaceMap
-> Module -- this module
-> Module -- semantic module
-> WarningMap
@@ -540,7 +542,7 @@ mkExportItems
-> DynFlags
-> ErrMsgGhc [ExportItem Name]
mkExportItems
- modMap thisMod semMod warnings gre exportedNames decls
+ is_sig modMap thisMod semMod warnings gre exportedNames decls
maps@(docMap, argMap, subMap, declMap, instMap) fixMap splices optExports instIfaceMap dflags =
case optExports of
Nothing -> fullModuleContents dflags warnings gre maps fixMap splices decls
@@ -569,8 +571,9 @@ mkExportItems
Just doc -> return . ExportDoc $ processDocStringParas dflags gre doc
declWith :: Name -> ErrMsgGhc [ ExportItem Name ]
- declWith t =
- case findDecl t of
+ declWith t = do
+ r <- findDecl t
+ case r of
([L l (ValD _)], (doc, _)) -> do
-- Top-level binding without type signature
export <- hiValExportItem dflags t l doc (l `elem` splices) $ M.lookup t fixMap
@@ -649,13 +652,32 @@ mkExportItems
isExported = (`elem` exportedNames)
- findDecl :: Name -> ([LHsDecl Name], (DocForDecl Name, [(Name, DocForDecl Name)]))
+ findDecl :: Name -> ErrMsgGhc ([LHsDecl Name], (DocForDecl Name, [(Name, DocForDecl Name)]))
findDecl n
- | m == semMod, Just ds <- M.lookup n declMap =
- (ds, lookupDocs n warnings docMap argMap subMap)
- | Just iface <- M.lookup (semToIdMod (moduleUnitId thisMod) m) modMap, Just ds <- M.lookup n (ifaceDeclMap iface) =
- (ds, lookupDocs n warnings (ifaceDocMap iface) (ifaceArgMap iface) (ifaceSubMap iface))
- | otherwise = ([], (noDocForDecl, []))
+ | m == semMod =
+ case M.lookup n declMap of
+ Just ds -> return (ds, lookupDocs n warnings docMap argMap subMap)
+ Nothing
+ | is_sig -> do
+ -- OK, so it wasn't in the local declaration map. It could
+ -- have been inherited from a signature. Reconstitute it
+ -- from the type.
+ mb_r <- hiDecl dflags n
+ case mb_r of
+ Nothing -> return ([], (noDocForDecl, []))
+ -- TODO: If we try harder, we might be able to find
+ -- a Haddock! Look in the Haddocks for each thing in
+ -- requirementContext (pkgState)
+ Just decl -> return ([decl], (noDocForDecl, []))
+ | otherwise ->
+ return ([], (noDocForDecl, []))
+ | Just iface <- M.lookup (semToIdMod (moduleUnitId thisMod) m) modMap
+ , Just ds <- M.lookup n (ifaceDeclMap iface) =
+ return (ds, lookupDocs n warnings
+ (ifaceDocMap iface)
+ (ifaceArgMap iface)
+ (ifaceSubMap iface))
+ | otherwise = return ([], (noDocForDecl, []))
where
m = nameModule n
--
cgit v1.2.3
From e3568da479b6297e48b8b83ee067174717fdbe22 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Tue, 14 Mar 2017 14:23:35 -0700
Subject: Fix haddock-test to work with latest version of Cabal.
Signed-off-by: Edward Z. Yang
(cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267)
---
haddock-test/src/Test/Haddock/Config.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index dea101d8..e1e920f2 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -237,7 +237,7 @@ baseDependencies ghcPath = do
exitFailure
(ifArg:_) -> pure ifArg
ifaces pkgIndex name = do
- pkg <- join $ snd <$> lookupPackageName pkgIndex (PackageName name)
+ pkg <- join $ snd <$> lookupPackageName pkgIndex (mkPackageName name)
iface <$> haddockInterfaces pkg <*> haddockHTMLs pkg
iface file html = "--read-interface=" ++ html ++ "," ++ file
--
cgit v1.2.3
From ef93eaac9bc0ca40073763d2e18ced3a51679ead Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Wed, 22 Mar 2017 13:48:12 -0700
Subject: Annotate signature docs with (signature)
Signed-off-by: Edward Z. Yang
(cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1)
---
haddock-api/src/Haddock/Backends/Xhtml.hs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 34911b11..fc26afbb 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -482,13 +482,16 @@ ppHtmlModule odir doctitle themes
mdl = ifaceMod iface
aliases = ifaceModuleAliases iface
mdl_str = moduleString mdl
+ mdl_str_annot = mdl_str ++ if ifaceIsSig iface
+ then " (signature)"
+ else ""
real_qual = makeModuleQual qual aliases mdl
html =
- headHtml mdl_str (Just $ "mini_" ++ moduleHtmlFile mdl) themes maybe_mathjax_url +++
+ headHtml mdl_str_annot (Just $ "mini_" ++ moduleHtmlFile mdl) themes maybe_mathjax_url +++
bodyHtml doctitle (Just iface)
maybe_source_url maybe_wiki_url
maybe_contents_url maybe_index_url << [
- divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str)),
+ divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str_annot)),
ifaceToHtml maybe_source_url maybe_wiki_url iface unicode real_qual
]
--
cgit v1.2.3
From 0567d936e02dcbc41c62b4dd63c7aaafc3383844 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang"
Date: Wed, 22 Mar 2017 14:11:25 -0700
Subject: Render help documentation link next to (signature) in title.
Signed-off-by: Edward Z. Yang
(cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe)
---
haddock-api/resources/html/Ocean.std-theme/ocean.css | 5 +++++
haddock-api/src/Haddock/Backends/Xhtml.hs | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css
index e8e4d705..29af691b 100644
--- a/haddock-api/resources/html/Ocean.std-theme/ocean.css
+++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css
@@ -88,6 +88,11 @@ pre, code, kbd, samp, tt, .src {
font-size: 182%; /* 24pt */
}
+#module-header .caption sup {
+ font-size: 70%;
+ font-weight: normal;
+}
+
.info {
font-size: 85%; /* 11pt */
}
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index fc26afbb..4cb028b8 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -485,13 +485,17 @@ ppHtmlModule odir doctitle themes
mdl_str_annot = mdl_str ++ if ifaceIsSig iface
then " (signature)"
else ""
+ mdl_str_linked = mdl_str +++
+ " (signature" +++
+ sup << ("[" +++ anchor ! [href signatureDocURL] << "?" +++ "]" ) +++
+ ")"
real_qual = makeModuleQual qual aliases mdl
html =
headHtml mdl_str_annot (Just $ "mini_" ++ moduleHtmlFile mdl) themes maybe_mathjax_url +++
bodyHtml doctitle (Just iface)
maybe_source_url maybe_wiki_url
maybe_contents_url maybe_index_url << [
- divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str_annot)),
+ divModuleHeader << (moduleInfo iface +++ (sectionName << mdl_str_linked)),
ifaceToHtml maybe_source_url maybe_wiki_url iface unicode real_qual
]
@@ -499,6 +503,9 @@ ppHtmlModule odir doctitle themes
writeFile (joinPath [odir, moduleHtmlFile mdl]) (renderToString debug html)
ppHtmlModuleMiniSynopsis odir doctitle themes maybe_mathjax_url iface unicode real_qual debug
+signatureDocURL :: String
+signatureDocURL = "https://wiki.haskell.org/Module_signature"
+
ppHtmlModuleMiniSynopsis :: FilePath -> String -> Themes
-> Maybe String -> Interface -> Bool -> Qualification -> Bool -> IO ()
ppHtmlModuleMiniSynopsis odir _doctitle themes maybe_mathjax_url iface unicode qual debug = do
--
cgit v1.2.3
From 18ed871afb82560d5433b2f53e31b4db9353a74e Mon Sep 17 00:00:00 2001
From: Phil Ruffwind
Date: Sat, 1 Apr 2017 05:05:06 -0400
Subject: Update MathJax URL
MathJax is shutting down their CDN:
https://www.mathjax.org/cdn-shutting-down/
They recommend migrating to cdnjs.
---
haddock-api/src/Haddock/Backends/Xhtml.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs
index 4cb028b8..c5caa6a2 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml.hs
@@ -126,7 +126,7 @@ headHtml docTitle miniPage themes mathjax_url =
]
where
setSynopsis = maybe "" (\p -> "setSynopsis(\"" ++ p ++ "\");") miniPage
- mjUrl = maybe "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" id mathjax_url
+ mjUrl = maybe "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" id mathjax_url
srcButton :: SourceURLs -> Maybe Interface -> Maybe Html
--
cgit v1.2.3
From 1185aba1fd0727028dc223380c811ec98a42605c Mon Sep 17 00:00:00 2001
From: David Turner
Date: Fri, 17 Mar 2017 12:04:04 +0000
Subject: Add highlight for :target to ocean.css
---
haddock-api/resources/html/Ocean.std-theme/ocean.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css
index 29af691b..9d2c644f 100644
--- a/haddock-api/resources/html/Ocean.std-theme/ocean.css
+++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css
@@ -614,4 +614,8 @@ div#style-menu-holder {
float: right;
}
+:target {
+ background-color: #ffff00;
+}
+
/* @end */
--
cgit v1.2.3
From 02a633476f68c9a8efe579abfd4745a08d145f89 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 19:35:58 +0200
Subject: Allow base-4.10 for haddock-test
---
haddock-test/haddock-test.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-test/haddock-test.cabal b/haddock-test/haddock-test.cabal
index 7cb15d7d..ef928e78 100644
--- a/haddock-test/haddock-test.cabal
+++ b/haddock-test/haddock-test.cabal
@@ -16,7 +16,7 @@ library
default-language: Haskell2010
ghc-options: -Wall
hs-source-dirs: src
- build-depends: base >= 4.3 && < 4.10, bytestring, directory, process, filepath, Cabal, xml, xhtml, syb
+ build-depends: base >= 4.3 && < 4.11, bytestring, directory, process, filepath, Cabal, xml, xhtml, syb
exposed-modules:
Test.Haddock
--
cgit v1.2.3
From 8260f433c5e7b9baf47ae94f2208a2eedfad189d Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 19:38:00 +0200
Subject: cabal.project for haddock-api, haddock-library and haddock-test
---
.gitignore | 1 +
cabal.project | 3 +++
2 files changed, 4 insertions(+)
create mode 100644 cabal.project
diff --git a/.gitignore b/.gitignore
index 2bbb0885..5d82bc96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/dist/
+/dist-newstyle/
/haddock-api/dist/
/haddock-library/dist/
/haddock-test/dist/
diff --git a/cabal.project b/cabal.project
new file mode 100644
index 00000000..b48ea111
--- /dev/null
+++ b/cabal.project
@@ -0,0 +1,3 @@
+packages: ./haddock-api
+ ./haddock-library
+ ./haddock-test
\ No newline at end of file
--
cgit v1.2.3
From 62ae5e71ceaee2e5ae58c87f870cdc5ccfe67e33 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 19:46:29 +0200
Subject: Move dist scripts to scripts/
---
build-windows-dist.sh | 18 ------------------
make-sdist.sh | 36 ------------------------------------
scripts/build-windows-dist.sh | 18 ++++++++++++++++++
scripts/make-sdist.sh | 36 ++++++++++++++++++++++++++++++++++++
4 files changed, 54 insertions(+), 54 deletions(-)
delete mode 100644 build-windows-dist.sh
delete mode 100644 make-sdist.sh
create mode 100644 scripts/build-windows-dist.sh
create mode 100644 scripts/make-sdist.sh
diff --git a/build-windows-dist.sh b/build-windows-dist.sh
deleted file mode 100644
index 2ae7dd2a..00000000
--- a/build-windows-dist.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-# mini script for building the relocatable Windows binary distribution.
-#
-# sh build-windows-dist.sh
-#
-# NB. the Cabal that shipped with GHC 6.6 isn't enough for this, because it
-# is missing this patch:
-#
-# Fri Oct 13 11:09:41 BST 2006 Simon Marlow
-# * Fix getDataDir etc. when bindir=$prefix
-#
-# So you need to use a more recent Cabal. GHC 6.6 is fine for building the
-# package, though.
-
-ghc --make Setup
-./Setup configure --prefix=`pwd`/install --bindir='$prefix' --libdir='$prefix' --datadir='$prefix'
-./Setup build
-./Setup install
-echo Now zip up `pwd`/install as "haddock--Win32.zip"
diff --git a/make-sdist.sh b/make-sdist.sh
deleted file mode 100644
index 914bf909..00000000
--- a/make-sdist.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-# Put the Happy-generated .hs files in the right place in the source dist.
-set -e
-rm -f dist/haddock-*.tar.gz
-rm -rf dist/haddock-*/
-./Setup sdist
-cd dist
-tar xvzf haddock-*.tar.gz
-cd haddock-*/
-mkdir dist
-mkdir dist/build
-mv haddock dist/build
-cd ..
-tar cvzf haddock-*.tar.gz haddock-*/
-
-# Steps for doing a release:
-# * Update version number in .cabal, doc/haddock.xml
-# * Update CHANGES
-# * Source:
-# - do the above
-# - upload the dist to haskell.org:haddock/dist/${version}
-# - scp CHANGES haskell.org:haddock/CHANGES.txt
-# * Binaries:
-# - build the Windows binary zip (see build-windows-dist.sh)
-# - scp haddock--Win32.zip haskell.org:haddock/dist
-# * Documentation:
-# - cd doc
-# - make html
-# - mv haddock haddock-html
-# - tar cvzf haddock-doc-html-${version}.tar.gz haddock-html
-# - scp haddock-doc-html-${version}.tar.gz www.haskell.org:../haskell/haddock/doc
-# - ssh haskell.org
-# - cd haddock/doc
-# - tar xvzf haddock-doc-html-${version}.tar.gz
-# - rm -rf html-OLD
-# - mv html html-OLD && mv haddock-html html
-# * Update the web page (~/darcs/www/haddock/index.html), and push it
diff --git a/scripts/build-windows-dist.sh b/scripts/build-windows-dist.sh
new file mode 100644
index 00000000..2ae7dd2a
--- /dev/null
+++ b/scripts/build-windows-dist.sh
@@ -0,0 +1,18 @@
+# mini script for building the relocatable Windows binary distribution.
+#
+# sh build-windows-dist.sh
+#
+# NB. the Cabal that shipped with GHC 6.6 isn't enough for this, because it
+# is missing this patch:
+#
+# Fri Oct 13 11:09:41 BST 2006 Simon Marlow
+# * Fix getDataDir etc. when bindir=$prefix
+#
+# So you need to use a more recent Cabal. GHC 6.6 is fine for building the
+# package, though.
+
+ghc --make Setup
+./Setup configure --prefix=`pwd`/install --bindir='$prefix' --libdir='$prefix' --datadir='$prefix'
+./Setup build
+./Setup install
+echo Now zip up `pwd`/install as "haddock--Win32.zip"
diff --git a/scripts/make-sdist.sh b/scripts/make-sdist.sh
new file mode 100644
index 00000000..914bf909
--- /dev/null
+++ b/scripts/make-sdist.sh
@@ -0,0 +1,36 @@
+# Put the Happy-generated .hs files in the right place in the source dist.
+set -e
+rm -f dist/haddock-*.tar.gz
+rm -rf dist/haddock-*/
+./Setup sdist
+cd dist
+tar xvzf haddock-*.tar.gz
+cd haddock-*/
+mkdir dist
+mkdir dist/build
+mv haddock dist/build
+cd ..
+tar cvzf haddock-*.tar.gz haddock-*/
+
+# Steps for doing a release:
+# * Update version number in .cabal, doc/haddock.xml
+# * Update CHANGES
+# * Source:
+# - do the above
+# - upload the dist to haskell.org:haddock/dist/${version}
+# - scp CHANGES haskell.org:haddock/CHANGES.txt
+# * Binaries:
+# - build the Windows binary zip (see build-windows-dist.sh)
+# - scp haddock--Win32.zip haskell.org:haddock/dist
+# * Documentation:
+# - cd doc
+# - make html
+# - mv haddock haddock-html
+# - tar cvzf haddock-doc-html-${version}.tar.gz haddock-html
+# - scp haddock-doc-html-${version}.tar.gz www.haskell.org:../haskell/haddock/doc
+# - ssh haskell.org
+# - cd haddock/doc
+# - tar xvzf haddock-doc-html-${version}.tar.gz
+# - rm -rf html-OLD
+# - mv html html-OLD && mv haddock-html html
+# * Update the web page (~/darcs/www/haddock/index.html), and push it
--
cgit v1.2.3
From 39642e46e98157f5f7e547987c798c9698c871c7 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 20:34:46 +0200
Subject: Add haddock to cabal.project
---
cabal.project | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cabal.project b/cabal.project
index b48ea111..ba925e3d 100644
--- a/cabal.project
+++ b/cabal.project
@@ -1,3 +1,4 @@
-packages: ./haddock-api
+packages: ./
+ ./haddock-api
./haddock-library
- ./haddock-test
\ No newline at end of file
+ ./haddock-test
--
cgit v1.2.3
From e0ada1743cb722d2f82498a95b201f3ffb303137 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 20:35:08 +0200
Subject: Read files for hyperlinker eagerly
This also exposes Documentation.Haddock.Utf8
---
haddock-api/src/Haddock/Interface/Create.hs | 12 ++++++++----
haddock-library/haddock-library.cabal | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index e594feae..d2ad9294 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -19,6 +19,7 @@
module Haddock.Interface.Create (createInterface) where
import Documentation.Haddock.Doc (metaDocAppend)
+import Documentation.Haddock.Utf8 as Utf8
import Haddock.Types
import Haddock.Options
import Haddock.GhcUtils
@@ -29,6 +30,7 @@ import Haddock.Backends.Hyperlinker.Types
import Haddock.Backends.Hyperlinker.Ast as Hyperlinker
import Haddock.Backends.Hyperlinker.Parser as Hyperlinker
+import qualified Data.ByteString as BS
import qualified Data.Map as M
import Data.Map (Map)
import Data.List
@@ -38,6 +40,7 @@ import Data.Ord
import Control.Applicative
import Control.Arrow (second)
import Control.DeepSeq
+import Control.Exception (evaluate)
import Control.Monad
import Data.Function (on)
@@ -976,10 +979,11 @@ mkMaybeTokenizedSrc flags tm
summary = pm_mod_summary . tm_parsed_module $ tm
mkTokenizedSrc :: ModSummary -> RenamedSource -> IO [RichToken]
-mkTokenizedSrc ms src =
- Hyperlinker.enrich src . Hyperlinker.parse <$> rawSrc
- where
- rawSrc = readFile $ msHsFilePath ms
+mkTokenizedSrc ms src = do
+ -- make sure to read the whole file at once otherwise
+ -- we run out of file descriptors (see #495)
+ rawSrc <- BS.readFile (msHsFilePath ms) >>= evaluate
+ return $ Hyperlinker.enrich src (Hyperlinker.parse (decodeUtf8 rawSrc))
-- | Find a stand-alone documentation comment by its name.
findNamedDoc :: String -> [HsDecl Name] -> ErrMsgM (Maybe HsDocString)
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index cabfbc67..4e355dd1 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -34,6 +34,7 @@ library
Documentation.Haddock.Parser.Monad
Documentation.Haddock.Types
Documentation.Haddock.Doc
+ Documentation.Haddock.Utf8
other-modules:
Data.Attoparsec
@@ -48,7 +49,6 @@ library
Data.Attoparsec.Internal.Types
Data.Attoparsec.Number
Documentation.Haddock.Parser.Util
- Documentation.Haddock.Utf8
test-suite spec
type: exitcode-stdio-1.0
--
cgit v1.2.3
From b44676d9acd36b50a93aea6882751284d00013b6 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 11 Apr 2017 20:37:06 +0200
Subject: Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create
---
haddock-api/src/Haddock/Interface/Create.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index d2ad9294..6ff1223c 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -39,7 +39,7 @@ import Data.Monoid
import Data.Ord
import Control.Applicative
import Control.Arrow (second)
-import Control.DeepSeq
+import Control.DeepSeq (force)
import Control.Exception (evaluate)
import Control.Monad
import Data.Function (on)
--
cgit v1.2.3
From e9cd7b1b52228b9ef8e1bd4e6cb1f2583740fcee Mon Sep 17 00:00:00 2001
From: Kyrill Briantsev
Date: Thu, 12 Jan 2017 13:23:50 +0300
Subject: Prevent GHC API from doing optimization passes.
---
haddock-api/src/Haddock.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index bbaea359..6af0874a 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -397,7 +397,7 @@ withGhc' libDir flags ghcActs = runGhc (Just libDir) $ do
ghcMode = CompManager,
ghcLink = NoLink
}
- let dynflags'' = gopt_unset dynflags' Opt_SplitObjs
+ let dynflags'' = updOptLevel 0 $ gopt_unset dynflags' Opt_SplitObjs
defaultCleanupHandler dynflags'' $ do
-- ignore the following return-value, which is a list of packages
-- that may need to be re-linked: Haddock doesn't do any
--
cgit v1.2.3
From 3b64e93ec1811bb5741550a4956ea5f28be24443 Mon Sep 17 00:00:00 2001
From: Alexander Biehl
Date: Wed, 12 Apr 2017 16:32:04 +0200
Subject: Add @alexbiehl as maintaner
---
haddock-api/haddock-api.cabal | 2 +-
haddock-library/haddock-library.cabal | 2 +-
haddock.cabal | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index 922aa07c..f98a8202 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -6,7 +6,7 @@ description: Haddock is a documentation-generation tool for Haskell
license: BSD3
license-file: LICENSE
author: Simon Marlow, David Waern
-maintainer: Simon Hengel , Mateusz Kowalczyk
+maintainer: Alex Biehl , Simon Hengel , Mateusz Kowalczyk
homepage: http://www.haskell.org/haddock/
bug-reports: https://github.com/haskell/haddock/issues
copyright: (c) Simon Marlow, David Waern
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index 4e355dd1..463569a3 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -9,7 +9,7 @@ description: Haddock is a documentation-generation tool for Haskell
itself, see the ‘haddock’ package.
license: BSD3
license-file: LICENSE
-maintainer: Simon Hengel , Mateusz Kowalczyk
+maintainer: Alex Biehl , Simon Hengel , Mateusz Kowalczyk
homepage: http://www.haskell.org/haddock/
bug-reports: https://github.com/haskell/haddock/issues
category: Documentation
diff --git a/haddock.cabal b/haddock.cabal
index 6ebdad76..a79f8c78 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -6,7 +6,7 @@ description: Haddock is a documentation-generation tool for Haskell
license: BSD3
license-file: LICENSE
author: Simon Marlow, David Waern
-maintainer: Simon Hengel , Mateusz Kowalczyk
+maintainer: Alex Biehl , Simon Hengel , Mateusz Kowalczyk
homepage: http://www.haskell.org/haddock/
bug-reports: https://github.com/haskell/haddock/issues
copyright: (c) Simon Marlow, David Waern
--
cgit v1.2.3
From 99ec96e57ea6b002394c923201d46a67ecfb8e16 Mon Sep 17 00:00:00 2001
From: Alex Biehl
Date: Thu, 13 Apr 2017 07:27:18 +0200
Subject: Disable doctest with ghc-8.3
Currently doctest doesn't support ghc-head
---
.travis.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7fb97c8e..405f8753 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,13 +14,13 @@ before_install:
- cabal update
- cd haddock-library
- cabal install --only-dependencies --enable-tests
- - cabal install doctest
+# - cabal install doctest
# --ghc-options=-Werror
- cabal configure --enable-tests && cabal build && cabal test
- - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs
+# - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs
- cabal install
- cd ..
- (cd haddock-api/ && cabal install --only-dependencies --enable-tests && cabal configure --enable-tests && cabal build && cabal test && cabal install)
script:
- - cabal configure --enable-tests && cabal build && cabal test
\ No newline at end of file
+ - cabal configure --enable-tests && cabal build && cabal test
--
cgit v1.2.3
From 70885ce16e1b0b9bf19fe0efb85a48daa0e5c281 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 18 Apr 2017 16:45:32 +0200
Subject: Travis: Use ghc-8.2.1 on master
---
.travis.yml | 84 +++++++++++++++++++++++++++------
haddock-api/haddock-api.cabal | 5 +-
haddock-api/src/Haddock.hs | 25 ++++++----
haddock-library/haddock-library.cabal | 5 +-
haddock-test/src/Test/Haddock/Config.hs | 17 +++++--
haddock.cabal | 53 ++++++++++++---------
6 files changed, 136 insertions(+), 53 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 405f8753..c1f8f504 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,26 +1,80 @@
+# This Travis job script has been generated by a script via
+#
+# make_travis_yml_2.hs 'haddock.cabal'
+#
+# For more information, see https://github.com/hvr/multi-ghc-travis
+#
+language: c
sudo: false
+git:
+ submodules: false # whether to recursively clone submodules
+
+cache:
+ directories:
+ - $HOME/.cabal/packages
+ - $HOME/.cabal/store
+
+before_cache:
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+ # remove files that are regenerated by 'cabal update'
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
+
matrix:
include:
- - env: CABALVER=head GHCVER=head
- addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
+ - compiler: "ghc-8.2.1"
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
+ - compiler: "ghc-head"
+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
allow_failures:
- - env: CABALVER=head GHCVER=head
+ - compiler: "ghc-head"
before_install:
- - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
+ - HC=${CC}
+ - unset CC
+ - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
+ - PKGNAME='haddock'
+
+install:
- cabal --version
- - cabal update
- - cd haddock-library
- - cabal install --only-dependencies --enable-tests
-# - cabal install doctest
- # --ghc-options=-Werror
- - cabal configure --enable-tests && cabal build && cabal test
-# - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs
- - cabal install
- - cd ..
- - (cd haddock-api/ && cabal install --only-dependencies --enable-tests && cabal configure --enable-tests && cabal build && cabal test && cabal install)
+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
+ - BENCH=${BENCH---enable-benchmarks}
+ - TEST=${TEST---enable-tests}
+ - travis_retry cabal update -v
+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
+ - rm -fv cabal.project.local
+ - rm -f cabal.project.freeze
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
+# Here starts the actual work to be performed for the package under test;
+# any command which exits with a non-zero exit code causes the build to fail.
script:
- - cabal configure --enable-tests && cabal build && cabal test
+ - if [ -f configure.ac ]; then autoreconf -i; fi
+ - rm -rf dist/
+ - cabal sdist # test that a source-distribution can be generated
+ - cd dist/
+ - SRCTAR=(${PKGNAME}-*.tar.gz)
+ - SRC_BASENAME="${SRCTAR/%.tar.gz}"
+ - tar -xvf "./$SRC_BASENAME.tar.gz"
+ - cd "$SRC_BASENAME/"
+## from here on, CWD is inside the extracted source-tarball
+ - rm -fv cabal.project.local
+ # this builds all libraries and executables (without tests/benchmarks)
+ - rm -f cabal.project.freeze
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
+ # this builds all libraries and executables (including tests/benchmarks)
+ # - rm -rf ./dist-newstyle
+
+ # build & run tests
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
+
+# EOF
diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal
index f98a8202..921e16eb 100644
--- a/haddock-api/haddock-api.cabal
+++ b/haddock-api/haddock-api.cabal
@@ -12,7 +12,7 @@ bug-reports: https://github.com/haskell/haddock/issues
copyright: (c) Simon Marlow, David Waern
category: Documentation
build-type: Simple
-cabal-version: >= 1.10
+cabal-version: >= 2.0
stability: experimental
data-dir:
@@ -120,6 +120,9 @@ test-suite spec
, hspec
, QuickCheck == 2.*
+ build-tool-depends:
+ hspec-discover:hspec-discover
+
source-repository head
type: git
location: https://github.com/haskell/haddock.git
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 6af0874a..dec85b79 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -426,15 +426,22 @@ getHaddockLibDir flags =
#ifdef IN_GHC_TREE
getInTreeDir
#else
- d <- getDataDir -- provided by Cabal
- doesDirectoryExist d >>= \exists -> case exists of
- True -> return d
- False -> do
- -- If directory does not exist then we are probably invoking from
- -- ./dist/build/haddock/haddock so we use ./resources as a fallback.
- doesDirectoryExist "resources" >>= \exists_ -> case exists_ of
- True -> return "resources"
- False -> die ("Haddock's resource directory (" ++ d ++ ") does not exist!\n")
+ -- if data directory does not exist we are probably
+ -- invoking from either ./haddock-api or ./
+ let res_dirs = [ getDataDir -- provided by Cabal
+ , pure "resources"
+ , pure "haddock-api/resources"
+ ]
+
+ check get_path = do
+ p <- get_path
+ exists <- doesDirectoryExist p
+ pure $ if exists then Just p else Nothing
+
+ dirs <- mapM check res_dirs
+ case [p | Just p <- dirs] of
+ (p : _) -> return p
+ _ -> die "Haddock's resource directory does not exist!\n"
#endif
fs -> return (last fs)
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index 463569a3..b7a20758 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -14,7 +14,7 @@ homepage: http://www.haskell.org/haddock/
bug-reports: https://github.com/haskell/haddock/issues
category: Documentation
build-type: Simple
-cabal-version: >= 1.10
+cabal-version: >= 2.0
stability: experimental
library
@@ -78,6 +78,9 @@ test-suite spec
, hspec
, QuickCheck == 2.*
+ build-tool-depends:
+ hspec-discover:hspec-discover
+
source-repository head
type: git
subdir: haddock-library
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index e1e920f2..50616c7f 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -165,11 +165,18 @@ loadConfig ccfg dcfg flags files = do
cfgEnv <- (:) ("haddock_datadir", dcfgResDir dcfg) <$> getEnvironment
systemHaddockPath <- List.lookup "HADDOCK_PATH" <$> getEnvironment
- cfgHaddockPath <- case flagsHaddockPath flags <|> systemHaddockPath of
+ haddockOnPath <- findExecutable "haddock"
+
+ let haddock_path = msum [ flagsHaddockPath flags
+ , systemHaddockPath
+ , haddockOnPath
+ ]
+
+ cfgHaddockPath <- case haddock_path of
Just path -> pure path
- Nothing -> do
- hPutStrLn stderr $ "Haddock executable not specified"
- exitFailure
+ Nothing -> do
+ hPutStrLn stderr "Haddock executable not found"
+ exitFailure
ghcPath <- init <$> rawSystemStdout normal cfgHaddockPath
["--print-ghc-path"]
@@ -195,7 +202,7 @@ loadConfig ccfg dcfg flags files = do
let cfgAccept = FlagAccept `elem` flags
let cfgCheckConfig = ccfg
- let cfgDirConfig = dcfg
+ let cfgDirConfig = dcfg
return $ Config { .. }
diff --git a/haddock.cabal b/haddock.cabal
index a79f8c78..fa8a3531 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -12,9 +12,10 @@ bug-reports: https://github.com/haskell/haddock/issues
copyright: (c) Simon Marlow, David Waern
category: Documentation
build-type: Simple
-cabal-version: >= 1.10
+cabal-version: >= 2.0
stability: experimental
-
+tested-with: GHC==8.2.*, GHC==8.3
+
extra-source-files:
CHANGES
README.md
@@ -130,32 +131,40 @@ test-suite driver-test
test-suite html-test
type: exitcode-stdio-1.0
- default-language: Haskell2010
- main-is: Main.hs
- hs-source-dirs: html-test
- build-depends: base, filepath, haddock-test == 0.0.1
+ -- This tells cabal that this test depends on the executable
+ -- component 'haddock' from this very same package, as well
+ -- as adding the build-folder where the `haddock`
+ -- executable can be found in front of $PATH
+ build-tool-depends: haddock:haddock
+ default-language: Haskell2010
+ main-is: Main.hs
+ hs-source-dirs: html-test
+ build-depends: base, filepath, haddock-test == 0.0.1
test-suite hypsrc-test
- type: exitcode-stdio-1.0
- default-language: Haskell2010
- main-is: Main.hs
- hs-source-dirs: hypsrc-test
- build-depends: base, filepath, haddock-test == 0.0.1
- ghc-options: -Wall -fwarn-tabs
+ type: exitcode-stdio-1.0
+ build-tool-depends: haddock:haddock
+ default-language: Haskell2010
+ main-is: Main.hs
+ hs-source-dirs: hypsrc-test
+ build-depends: base, filepath, haddock-test == 0.0.1
+ ghc-options: -Wall -fwarn-tabs
test-suite latex-test
- type: exitcode-stdio-1.0
- default-language: Haskell2010
- main-is: Main.hs
- hs-source-dirs: latex-test
- build-depends: base, filepath, haddock-test == 0.0.1
+ type: exitcode-stdio-1.0
+ build-tool-depends: haddock:haddock
+ default-language: Haskell2010
+ main-is: Main.hs
+ hs-source-dirs: latex-test
+ build-depends: base, filepath, haddock-test == 0.0.1
test-suite hoogle-test
- type: exitcode-stdio-1.0
- default-language: Haskell2010
- main-is: Main.hs
- hs-source-dirs: hoogle-test
- build-depends: base, filepath, haddock-test == 0.0.1
+ type: exitcode-stdio-1.0
+ build-tool-depends: haddock:haddock
+ default-language: Haskell2010
+ main-is: Main.hs
+ hs-source-dirs: hoogle-test
+ build-depends: base, filepath, haddock-test == 0.0.1
source-repository head
type: git
--
cgit v1.2.3
From 83c460c13957ab0a9a30cfa8d5b9b095b9e8d804 Mon Sep 17 00:00:00 2001
From: Alex Biehl
Date: Tue, 25 Apr 2017 10:32:01 +0200
Subject: Travis: Verbose cabal output
cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377
---
.travis.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index c1f8f504..9bbd0d24 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,8 +51,8 @@ install:
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- rm -f cabal.project.freeze
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all -v3
+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all -v3
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
@@ -74,7 +74,7 @@ script:
# - rm -rf ./dist-newstyle
# build & run tests
- - cabal new-build -w ${HC} ${TEST} ${BENCH} all
- - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all -v3
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all -v3; fi
# EOF
--
cgit v1.2.3
From 862afa05d4ebada8e7b57f289cf31a53fb0a7dd9 Mon Sep 17 00:00:00 2001
From: Alex Biehl
Date: Tue, 25 Apr 2017 10:40:43 +0200
Subject: Use travis_retry for cabal invocations
---
.travis.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 9bbd0d24..f7a9d921 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,8 +51,8 @@ install:
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- rm -f cabal.project.freeze
- - cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all -v3
- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all -v3
+ - travis_retry cabal new-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all
+ - travis_retry cabal new-build -w ${HC} --disable-tests --disable-benchmarks --dep -j2 all
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
@@ -74,7 +74,7 @@ script:
# - rm -rf ./dist-newstyle
# build & run tests
- - cabal new-build -w ${HC} ${TEST} ${BENCH} all -v3
- - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all -v3; fi
+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
+ - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
# EOF
--
cgit v1.2.3
From 65fccc0fec773a745b1b6363aa5c0cd433949830 Mon Sep 17 00:00:00 2001
From: alexbiehl
Date: Tue, 25 Apr 2017 07:16:05 +0200
Subject: Use new MathJax URL in html-test
18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL
but didn't update the tests.
---
html-test/ref/A.html | 4 ++--
html-test/ref/B.html | 4 ++--
html-test/ref/Bold.html | 4 ++--
html-test/ref/Bug1.html | 4 ++--
html-test/ref/Bug195.html | 4 ++--
html-test/ref/Bug2.html | 4 ++--
html-test/ref/Bug201.html | 4 ++--
html-test/ref/Bug253.html | 4 ++--
html-test/ref/Bug26.html | 4 ++--
html-test/ref/Bug280.html | 2 +-
html-test/ref/Bug294.html | 4 ++--
html-test/ref/Bug298.html | 4 ++--
html-test/ref/Bug3.html | 4 ++--
html-test/ref/Bug308.html | 4 ++--
html-test/ref/Bug308CrossModule.html | 4 ++--
html-test/ref/Bug310.html | 4 ++--
html-test/ref/Bug313.html | 4 ++--
html-test/ref/Bug335.html | 4 ++--
html-test/ref/Bug387.html | 4 ++--
html-test/ref/Bug4.html | 4 ++--
html-test/ref/Bug6.html | 4 ++--
html-test/ref/Bug7.html | 4 ++--
html-test/ref/Bug8.html | 4 ++--
html-test/ref/Bug85.html | 4 ++--
html-test/ref/BugDeprecated.html | 4 ++--
html-test/ref/BugExportHeadings.html | 4 ++--
html-test/ref/Bugs.html | 4 ++--
html-test/ref/DeprecatedClass.html | 4 ++--
html-test/ref/DeprecatedData.html | 4 ++--
html-test/ref/DeprecatedFunction.html | 4 ++--
html-test/ref/DeprecatedFunction2.html | 4 ++--
html-test/ref/DeprecatedFunction3.html | 4 ++--
html-test/ref/DeprecatedModule.html | 4 ++--
html-test/ref/DeprecatedModule2.html | 4 ++--
html-test/ref/DeprecatedNewtype.html | 4 ++--
html-test/ref/DeprecatedReExport.html | 4 ++--
html-test/ref/DeprecatedRecord.html | 4 ++--
html-test/ref/DeprecatedTypeFamily.html | 4 ++--
html-test/ref/DeprecatedTypeSynonym.html | 4 ++--
html-test/ref/Examples.html | 4 ++--
html-test/ref/Extensions.html | 4 ++--
html-test/ref/FunArgs.html | 4 ++--
html-test/ref/GADTRecords.html | 4 ++--
html-test/ref/Hash.html | 4 ++--
html-test/ref/HiddenInstances.html | 4 ++--
html-test/ref/HiddenInstancesB.html | 4 ++--
html-test/ref/Hyperlinks.html | 4 ++--
html-test/ref/IgnoreExports.html | 4 ++--
html-test/ref/ImplicitParams.html | 4 ++--
html-test/ref/Instances.html | 4 ++--
html-test/ref/Math.html | 4 ++--
html-test/ref/Minimal.html | 4 ++--
html-test/ref/ModuleWithWarning.html | 4 ++--
html-test/ref/NamedDoc.html | 4 ++--
html-test/ref/Nesting.html | 4 ++--
html-test/ref/NoLayout.html | 4 ++--
html-test/ref/NonGreedy.html | 4 ++--
html-test/ref/Operators.html | 4 ++--
html-test/ref/OrphanInstances.html | 4 ++--
html-test/ref/OrphanInstancesClass.html | 4 ++--
html-test/ref/OrphanInstancesType.html | 4 ++--
html-test/ref/PatternSyns.html | 4 ++--
html-test/ref/PromotedTypes.html | 4 ++--
html-test/ref/Properties.html | 4 ++--
html-test/ref/PruneWithWarning.html | 4 ++--
html-test/ref/QuasiExpr.html | 4 ++--
html-test/ref/QuasiQuote.html | 4 ++--
html-test/ref/SpuriousSuperclassConstraints.html | 4 ++--
html-test/ref/TH.html | 4 ++--
html-test/ref/TH2.html | 4 ++--
html-test/ref/Test.html | 4 ++--
html-test/ref/Threaded.html | 4 ++--
html-test/ref/Threaded_TH.html | 4 ++--
html-test/ref/Ticket112.html | 4 ++--
html-test/ref/Ticket61.html | 4 ++--
html-test/ref/Ticket75.html | 4 ++--
html-test/ref/TitledPicture.html | 4 ++--
html-test/ref/TypeFamilies.html | 4 ++--
html-test/ref/TypeFamilies2.html | 4 ++--
html-test/ref/TypeOperators.html | 4 ++--
html-test/ref/Unicode.html | 4 ++--
html-test/ref/Visible.html | 4 ++--
html-test/ref/mini_A.html | 2 +-
html-test/ref/mini_AdvanceTypes.html | 2 +-
html-test/ref/mini_B.html | 2 +-
html-test/ref/mini_Bug1.html | 2 +-
html-test/ref/mini_Bug2.html | 2 +-
html-test/ref/mini_Bug3.html | 2 +-
html-test/ref/mini_Bug4.html | 2 +-
html-test/ref/mini_Bug6.html | 2 +-
html-test/ref/mini_Bug7.html | 2 +-
html-test/ref/mini_Bug8.html | 2 +-
html-test/ref/mini_BugDeprecated.html | 2 +-
html-test/ref/mini_BugExportHeadings.html | 2 +-
html-test/ref/mini_Bugs.html | 2 +-
html-test/ref/mini_DeprecatedClass.html | 2 +-
html-test/ref/mini_DeprecatedData.html | 2 +-
html-test/ref/mini_DeprecatedFunction.html | 2 +-
html-test/ref/mini_DeprecatedFunction2.html | 2 +-
html-test/ref/mini_DeprecatedFunction3.html | 2 +-
html-test/ref/mini_DeprecatedModule.html | 2 +-
html-test/ref/mini_DeprecatedModule2.html | 2 +-
html-test/ref/mini_DeprecatedNewtype.html | 2 +-
html-test/ref/mini_DeprecatedReExport.html | 2 +-
html-test/ref/mini_DeprecatedRecord.html | 2 +-
html-test/ref/mini_DeprecatedTypeFamily.html | 2 +-
html-test/ref/mini_DeprecatedTypeSynonym.html | 2 +-
html-test/ref/mini_Examples.html | 2 +-
html-test/ref/mini_FunArgs.html | 2 +-
html-test/ref/mini_GADTRecords.html | 2 +-
html-test/ref/mini_Hash.html | 2 +-
html-test/ref/mini_HiddenInstances.html | 2 +-
html-test/ref/mini_HiddenInstancesB.html | 2 +-
html-test/ref/mini_Hyperlinks.html | 2 +-
html-test/ref/mini_IgnoreExports.html | 2 +-
html-test/ref/mini_Math.html | 2 +-
html-test/ref/mini_ModuleWithWarning.html | 2 +-
html-test/ref/mini_NamedDoc.html | 2 +-
html-test/ref/mini_NoLayout.html | 2 +-
html-test/ref/mini_NonGreedy.html | 2 +-
html-test/ref/mini_Properties.html | 2 +-
html-test/ref/mini_PruneWithWarning.html | 2 +-
html-test/ref/mini_QuasiExpr.html | 2 +-
html-test/ref/mini_QuasiQuote.html | 2 +-
html-test/ref/mini_SpuriousSuperclassConstraints.html | 2 +-
html-test/ref/mini_TH.html | 2 +-
html-test/ref/mini_TH2.html | 2 +-
html-test/ref/mini_Test.html | 2 +-
html-test/ref/mini_Ticket112.html | 2 +-
html-test/ref/mini_Ticket61.html | 2 +-
html-test/ref/mini_Ticket75.html | 2 +-
html-test/ref/mini_TitledPicture.html | 2 +-
html-test/ref/mini_TypeFamilies.html | 2 +-
html-test/ref/mini_TypeOperators.html | 2 +-
html-test/ref/mini_Unicode.html | 2 +-
html-test/ref/mini_Visible.html | 2 +-
136 files changed, 217 insertions(+), 217 deletions(-)
diff --git a/html-test/ref/A.html b/html-test/ref/A.html
index b58845e5..64a2916b 100644
--- a/html-test/ref/A.html
+++ b/html-test/ref/A.html
@@ -6,7 +6,7 @@
>