ekmett/lens

Dead link in description

Lysxia opened this issue · 1 comments

Lysxia commented

The link to the "local copy" of the picture of the lens hierarchy in the lens.cabal description goes to https://hackage.haskell.org/package/lens-5.2/images/Hierarchy.png which is 404.

<images/Hierarchy.png (Local Copy)>

Hm. If you build the Haddocks locally, then the link does work. The reason that it doesn't work on Hackage is because the link is here:

https://hackage.haskell.org/package/lens-5.2/src/images/Hierarchy.png

Instead of here:

https://hackage.haskell.org/package/lens-5.2/images/Hierarchy.png

Notice the additional src/ subdirectory in the first URL. You might think that you could fix the issue by changing the link to the local copy like so:

diff --git a/lens.cabal b/lens.cabal
index 6acf6115..5bf54a47 100644
--- a/lens.cabal
+++ b/lens.cabal
@@ -50,7 +50,7 @@ description:
   .
   <<http://i.imgur.com/ALlbPRa.png>>
   .
-  <images/Hierarchy.png (Local Copy)>
+  <src/images/Hierarchy.png (Local Copy)>
   .
   You can compose any two elements of the hierarchy above using @(.)@ from the @Prelude@, and you can
   use any element of the hierarchy as any type it linked to above it.

But then the link will be broken if you build the Haddocks locally! Ugh.


Now that I look a little more closely, we've encountered this same issue in ekmett/semigroupoids#123. We were unable to figure out a consistent way to link to local images in Haddock and have it still work on Hackage, so we resorted to linking to a copy of the image on GitHub. This does work regardless of whether you view the Haddocks locally or on Hackage, but it's arguably not a "local" copy anymore.

In the absence of a better solution, I think we should just link to GitHub.