rebuilding haddock docs

Mark Lentczner markl at
Mon Jul 26 01:45:55 EDT 2010

I thought it would be good to regenerate all the haddock documentation on my system with the new haddock. This would give me a nice big corpus of output to look at and see how it feels. It would also be nice if, after we release new haddock, if we could give people a script that they could run and it would do this for them.(*)

As far as I can see, there really is no way to run haddock manually for a real package. There are just too many command line options that have to be calculated in just the same way cabal does. (I figured this out by replacing my haddock with a wrapper that dumped all the arguments, and then let cabal reinstall a package I had.) 

So, seems like the plan would be:
1. use ghc-pkg to get a list of all install packages and versions. 
2. for each package:
	2.1 cabal unpack <package>-<version>
	2.2 cd <package>-<version>
	2.3 cabal configure
	2.4 cabal haddock --with-haddock=<new-haddock>
	2.5 move dist/doc/html/<package> to some new doc tree
	2.6 cd ..
3. run haddock --gen-contents --gen-index reading all the interface files from the doc tree

Some hurdles in my mind:
• may need to do this in package dependency order
• step 2.4 reads the interface file and location of dependent packages - these would need to be adjusted for the new doc tree somehow - not sure I see how to do this without building a covert ghc-pkg database for just this whole exercise - but then I think I'd have to ACTUALLY install them 

Ideas? Is this plain crazy?

	- Mark

(*) Here's an issue: If we don't give users a script for rebuilding their docs, then when they install new packages, after upgrading haddock, new and old docs won't cross link, because the anchors changed.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Haddock mailing list