There are a few resources I’ve found that point out how to generate Haddocks for Hackage:
- How to upload haddocks to Hackage? · Issue #5821 · haskell/cabal · GitHub
- Uploading packages and package candidates | Hackage
- [Resolved] What steps are needed to upload docs to hackage?
They all say you should generate Haddocks with
cabal haddock ... --haddock-for-hackage --enable-doc
but when I do this half of the documentation is missing. Compare:
- Generated by Hackage itself: Bluefin.State
- Generated by the command line above and uploaded by me: Bluefin.State
You can see that all the function documentation is missing from the latter. EDIT: I’ve now uploaded the fixed version, so it not longer exhibits the bad behaviour.
What’s weird is that when I run the cabal haddock command locally it also generates bluefin-internal documentation, because it’s a dependency, and that documentation is correct. Now bluefin just re-exports identifiers from bluefin-internal, but somehow the documentation is not getting pulled over too. Furthermore, if I run cabal haddock without --haddock-for-hackage, everything is fine.
The documentation is generated correctly when Hackage does it, so I guess I must be missing a flag or some other form of configuration. Does anyone know what?
EDIT: The --help says:
--haddock-for-hackage Collection of flags to generate documentation
but it’s not clear what flags --haddock-for-hackage stands in for so I can’t play around with those to debug. Does anyone know what the collection of flags is?