[Haskell-cafe] Cabal: local documentation

Martijn van Steenbergen martijn at van.steenbergen.nl
Wed Feb 25 08:29:54 EST 2009

Duncan Coutts wrote:
> On Tue, 2009-02-24 at 17:42 +0100, Svein Ove Aas wrote:
>> 2009/2/24 Felipe Lessa <felipe.lessa at gmail.com>:
>>> 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!



<title>Local Hackage packages</title>
<h1>Local Hackage packages</h1>

$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";


More information about the Haskell-Cafe mailing list