diff options
author | Yuchen Pei <hi@ypei.me> | 2022-07-18 12:38:03 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-07-18 18:09:23 +1000 |
commit | d64bbb227fcf357ba496928c70cd0b91244bcae8 (patch) | |
tree | d52524970d027fe841cb7e3d800e711113150045 /haddock-api | |
parent | dd392e27526983833359d3ea5bf2b0b60236e991 (diff) |
removing hackage url for ids
Diffstat (limited to 'haddock-api')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Org.hs | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/haddock-api/src/Haddock/Backends/Org.hs b/haddock-api/src/Haddock/Backends/Org.hs index f0b91b50..7460be4a 100644 --- a/haddock-api/src/Haddock/Backends/Org.hs +++ b/haddock-api/src/Haddock/Backends/Org.hs @@ -471,7 +471,7 @@ ppTyClDecl (DataDecl _ (L _ name) tcdTyVars _ defn@(HsDataDefn { dd_ND = nd, dd_ ) : if gadt then [plaintext " where"] else [] ) - (cIdPaths path name ++ hackageUrlProp path name) + (cIdPaths path name) ] ++ ppDocForDecl docs (Just level) ++ ppDataDefn defn subdocs path (level + 1) @@ -494,7 +494,7 @@ ppTyClDecl (SynDecl _ (L _ name) tcdTyVars _fixity (L _ rhs)) docs _ path level ) ++ ppHsType rhs ) - (cIdPaths path name ++ hackageUrlProp path name) + (cIdPaths path name) ] ++ ppDocForDecl docs (Just level) -- class @@ -509,7 +509,7 @@ ppTyClDecl (ClassDecl {..}) docs subdocs path level = , intersperse Whitespace (map (Plain . ppName) (tyvarNames tcdTyVars)) ] ) - (cIdPaths path (unLoc tcdLName) ++ hackageUrlProp path (unLoc tcdLName)) + (cIdPaths path (unLoc tcdLName)) ] ++ ppDocForDecl docs (Just level) -- TODO: do we need an aDoc here instead of M.empty? @@ -528,7 +528,7 @@ ppTyClDecl (FamDecl _ (FamilyDecl _ (ClosedTypeFamily mbEqns) TopLevel (L _ name ++ maybe [] ppLInjectivityAnn mbInj ++ [plaintext " where"] ) - (cIdPaths path name ++ hackageUrlProp path name) + (cIdPaths path name) : ppDocForDecl docs (Just level) ++ concatMap (\x -> ppLTyFamInstEqn x subdocs path (level + 1)) (fromMaybe [] mbEqns) @@ -543,7 +543,7 @@ ppTyClDecl (FamDecl _ (FamilyDecl _ info TopLevel (L _ name) tyvars _fixity (L _ ++ ppFamilyResultSig resSig op ++ maybe [] ppLInjectivityAnn mbInj ) - (cIdPaths path name ++ hackageUrlProp path name) + (cIdPaths path name) : ppDocForDecl docs (Just level) where pre = case info of @@ -727,9 +727,7 @@ ppSig (TypeSig _ lhs rhs) (doc, aDoc) _ path level = ] ++ (ppHsSigType hsSig) ) - ( concatMap (cIdPaths path . unLoc) lhs - ++ concatMap (hackageUrlProp path . unLoc) lhs - ) + (concatMap (cIdPaths path . unLoc) lhs) : (if M.null aDoc then [] else ppHsSigTypeDoc hsSig aDoc) ++ ppDocumentation doc (Just level) where hsSig = unLoc (dropWildCards rhs) @@ -762,9 +760,7 @@ ppSig (PatSynSig _ names (L _ hsSig)) (doc, aDoc) _ path level = ] ++ (ppHsSigType hsSig) ) - ( concatMap (cIdPaths path . unLoc) names - ++ concatMap (hackageUrlProp path . unLoc) names - ) + (concatMap (cIdPaths path . unLoc) names) : (if M.null aDoc then [] else ppHsSigTypeDoc hsSig aDoc) ++ ppDocumentation doc (Just level) @@ -1014,14 +1010,6 @@ hackageModuleUrl pkg mdl = hackagePackageUrl pkg ++ "/docs/" ++ dotsToDashes mdl ++ ".html" where dotsToDashes = map (\c -> if c == '.' then '-' else c) -hackageUrl :: String -> String -> String -> String --- module should be of the form GHC-Hs-Decls instead of GHC.Hs.Decls -hackageUrl pkg mdl id = hackageModuleUrl pkg mdl ++ "#t:" ++ id - -hackageUrlProp :: ModPath -> DocName -> Properties -hackageUrlProp (pkg, mdl) name = - hackageProp (hackageUrl pkg mdl (docNameToString name)) - -- * Orphan instances for show instance Show DocName where |