문제

After I upload my package into hackages, it didn't generate haddock as others packages.

Anything I missed?

What I did is:

  1. cabal dist and a package generated under dist directory.
  2. open hackage web upload interface and upload the package.
  3. open the URL and turns out package uploaded successfully but no haddock. (the package do have a few docs)

Thank you.

도움이 되었습니까?

해결책

Docs take a little bit of time to generate. I believe they are ran at midnight GMT.

다른 팁

In addition to Thomas's answer, run cabal haddock in your package directory and look for any errors.

Haddock is incredibly finicky in my experience, especially wrt. code blocks. If you get a parse error, just start deleting comments until docs can be generated. I usually use some extensively-documented package as a reference.

It looks like the documentation is missing because your package didn't build correctly. I found this near the end of the build log:

src/Network/OAuth2/HTTP/HttpClient.hs:18:8:
    Could not find module `Control.Monad.Trans.Resource'
    It is a member of the hidden package `resourcet-0.3.2.1'.
    Perhaps you need to add `resourcet' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

To avoid these sorts of problems, make sure your package builds locally with Cabal before uploading. Building with GHC directly will often mask these sorts of problems, since it will happily use whatever packages you have installed, regardless of whether you've mentioned them in your .cabal file or not.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top