How to instruct haddock to link to hackage documentation for hackage packages?

788 views Asked by At

So, I am using haddock (through cabal) to generate documentation for my local Haskell package. It has no trouble hyperlinking its own local html documents to each other. However, whenever my package references a symbol from another package, it does not create the link.

Most of my outside dependencies have haddock documentation on Hackage. Is there a way to set up haddock such that it can find the documentation of Hackage and hyperlink to it?

1

There are 1 answers

4
Pranay Sashank On

I usually do,

cabal v2-haddock --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs' --haddock-hyperlink-source --haddock-quickjump

The only problem for me with this approach is that, it may link with latest packages that are not yet available on Hackage. For example, when I run this on ghc-8.8 it links to base-4.13 which hasn't been released on Hackage yet.