
Hello, Can cabal automatically generate local documentation for packages I install? It'd be awesome if it generated a page like [1] for locally installed packages. Thanks, Martijn. [1] http://www.haskell.org/ghc/dist/current/docs/libraries/

Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc. HTH, -- Felipe.

On Tue, 2009-02-24 at 17:42 +0100, Svein Ove Aas wrote:
2009/2/24 Felipe Lessa
: Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc.
Or edit ~/.cabal/config and set the documentation key to True
However this does not maintain a complete module index like I think Martijn is after. It would be great if someone volunteered to implement that. There's a ticket open for it: http://hackage.haskell.org/trac/hackage/ticket/206 One question is where to put a central index. This is especially true for the case of global installations. For per-user installs it's probably fine to use ~/.cabal/share/doc/index.html or something, but for the case of /usr/local that's certainly not ok. Needs some thought. Duncan

Duncan Coutts wrote:
On Tue, 2009-02-24 at 17:42 +0100, Svein Ove Aas wrote:
2009/2/24 Felipe Lessa
: Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc.
Or edit ~/.cabal/config and set the documentation key to True
However this does not maintain a complete module index like I think Martijn is after.
Thank you all for the very helpful suggestions. I edited ~/.cabal/config to generate documentation by default, and I set up Apache to serve the documentation from http://haddock. I put a small PHP (gasp!) file in ~/.cabal/share/doc that lists all packages for which there is documentation; see below. This is a good enough approximation for now. Thanks again! Martijn. --- <html> <head> <title>Local Hackage packages</title> </head> <body> <h1>Local Hackage packages</h1> <ul> <? $handle = opendir(dirname(__FILE__)); while (false !== ($pkg = readdir($handle))) { if ($pkg == "." || $pkg == "..") continue; $link = "$pkg/html/"; if (file_exists("${link}index.html")) { echo '<li><a href="' . $link . '">' . $pkg . '</a></li>' . "\n"; } } ?> </ul> </body> </html>
participants (4)
-
Duncan Coutts
-
Felipe Lessa
-
Martijn van Steenbergen
-
Svein Ove Aas