Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haddock for Cabal-installed modules?

I'm using GHC and have installed several packages via Cabal. One of the packages' web site says "go see the haddock documentation". The haddock command seems to only work on source files, and cabal haddock only seems to work in the top-level directory of a project with a .cabal build file. Is there a way to say "show me the haddock" for a module?

I'm longing for pydoc -p 12345 which starts an HTTP server providing Python documentation based on what you have installed locally.

As a work-around, I extracted the source tarball from under ~/.cabal and ran cabal configure; cabal haddock in the source directory, but that's kind of a pain.

like image 232
Harold L Avatar asked Oct 19 '09 09:10

Harold L


1 Answers

edit your config file:

~/.cabal/config

there is a option to enable default install doc:

documentation: True

to install doc of existing packages, use:

cabal install xxx --reinstall

re-install docs from basic packages then the upper-level packages, so the "hyper-link" to other modules will be generated properly.

like image 85
wuxb Avatar answered Nov 28 '22 16:11

wuxb