aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Org.hs
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-07-18 12:38:03 +1000
committerYuchen Pei <hi@ypei.me>2022-07-21 13:00:43 +1000
commit4d983b21cf7bf5c851147d1a377fa56027275b84 (patch)
treec15b3ac16b81a54710206ac88ece045821376b60 /haddock-api/src/Haddock/Backends/Org.hs
parenta65f607c0c17df064dba3d65446e2cc05bc9d4c4 (diff)
removing hackage url for ids
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Org.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/Org.hs26
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