aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-14 17:52:19 +1000
committerYuchen Pei <hi@ypei.me>2022-09-15 12:46:12 +1000
commite8157ce5e664932641e26a9b87a8d4d3c4754ca3 (patch)
treee8a61b4773ad8e4932e449688088eba6ada17d27
parent52edd86b1d6db7d1fd0620080d244f84e80f1025 (diff)
changing to multiple files model
all files under the same dir
-rw-r--r--haddock-api/src/Haddock/Backends/Org.hs19
1 files changed, 9 insertions, 10 deletions
diff --git a/haddock-api/src/Haddock/Backends/Org.hs b/haddock-api/src/Haddock/Backends/Org.hs
index 128784d9..85b5919c 100644
--- a/haddock-api/src/Haddock/Backends/Org.hs
+++ b/haddock-api/src/Haddock/Backends/Org.hs
@@ -113,7 +113,6 @@ import GHC.Unit.Types ( GenModule(..)
import GHC.Utils.Outputable ( showPprUnsafe )
import qualified GHC.Utils.Ppr as Pretty
import GHC.Utils.Ppr ( (<+>)
- , (<>)
, comma
, hsep
, punctuate
@@ -471,20 +470,20 @@ parensIfMany xs org = if length xs > 1 then orgParens org else org
valOrTyp :: HasOccName n => n -> String
valOrTyp name = if isValOcc (occName name) then "v" else "t"
-idPath :: ModPath -> DocName -> String
-idPath (pkg, mdl) name =
- intercalate idPathSep [pkg, mdl, valOrTyp name, docNameToString name]
-
-idPath' :: Module -> DocName -> String
-idPath' mdl name =
- idPath (cleanPkgStr $ unitString $ moduleUnit mdl, moduleString mdl) name
+idPathTarget :: Module -> DocName -> String
+idPathTarget mdl name =
+ "file:"
+ ++ (cleanPkgStr $ unitString $ moduleUnit mdl)
+ ++ ".org::#"
+ ++ intercalate idPathSep
+ [moduleString mdl, valOrTyp name, docNameToString name]
idPathNoPkg :: HasOccName n => String -> n -> String
idPathNoPkg mdl name =
intercalate idPathSep [mdl, valOrTyp name, occNameString (occName name)]
cIdPaths :: ModPath -> DocName -> Properties
-cIdPaths path@(_, mdl) name = cIdsProp [idPath path name, idPathNoPkg mdl name]
+cIdPaths (_, mdl) name = cIdsProp [idPathNoPkg mdl name]
ppTyClDecl
:: TyClDecl DocNameI
@@ -946,7 +945,7 @@ ppPromoted flag = case flag of
ppDocName :: DocName -> [OrgInline]
ppDocName docName@(Documented _ mdl) =
- [Link (text "#" <> text (idPath' mdl docName)) [Plain $ docNameToDoc docName]]
+ [Link (text (idPathTarget mdl docName)) [Plain $ docNameToDoc docName]]
ppDocName docName@(Undocumented name) = case nameModule_maybe name of
Nothing -> [Plain $ docNameToDoc docName]
Just mdl -> ppDocName (Documented name mdl)