Skip to content

copyHtml seems break <a ...> tags in src/*.html #42

@duke13137

Description

@duke13137

Hi, thanks for developing such easy to use tool!

I ran into some strange "file not found" errors when navigating source (embedded) links in Dash. copy&paste those links to Browser, it appears they all have either /pkg/ or /src/ repeated twice in URL path.

I tried a quick hack like below (my understanding of code is limited). Nevertheless, everything works great after rebuilding doc set with that. FYI, I'm using ghc 8.0.2, and all haddock HTML pages are built with using "stack hoogle" or "stack haddock" command.

diff --git a/Documentation/Haddocset.hs b/Documentation/Haddocset.hs
index 2597ed4..919b430 100644
--- a/Documentation/Haddocset.hs
+++ b/Documentation/Haddocset.hs
@@ -207,14 +207,7 @@ copyHtml doc dst = do
     getAttr _             = error "copyHtml: call attr to !TagOpen."

     rebase :: FilePath -> FilePath
-    rebase p =
-        let file    = takeFileName p
-            isSrc   = "src" `elem` splitDirectories (parent p)
-            srcNize = if isSrc then ("src" </>) else id
-            pkgs    = filter packageLike . reverse $ splitDirectories (parent p)
-        in case pkgs of
-            []    -> file
-            pkg:_ -> ".." </> pkg </> srcNize file
+    rebase p = p

Cheers!
Feng

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions