RE: [Haskell-cafe] RE: Definition of the Haskell standard library

On Tue, 2007-07-31 at 17:26 +0100, Simon Peyton-Jones wrote:
| I see it as a really big deal that documentation becomes fragmented when | one is using many packages, so that it's harder to find what you want. | In fact, I'd classify that as the single biggest reason that I don't use | many packages now
When you install packages A,B,C, the documentation for A,B,C (and nothing else) ought to be locally available as an integrated whole, much as at the GHC web site. I don't know whether Cabal does, or could do, that, but it's surely what one would expect.
The docs for those packages would be available for packages installed via cabal (assuming the user did the optional haddock step) and would link to each other. What is missing from the local docs is a single integrated index page that lists all the modules and then links off to the various packages's docs like we have on the ghc website. The problem with generating one of those is what manages it? What package would it belong to etc. On some systems (windows, gnome) there are dedicated help viewers that can help with this contents/index issue. haddock supports both (mshelp, devhelp). I'm not sure everyone would find that a sufficient solution however. Duncan

Duncan Coutts
What is missing from the local docs is a single integrated index page that lists all the modules and then links off to the various packages's docs like we have on the ghc website.
The problem with generating one of those is what manages it? What package would it belong to etc.
Locally, I've kludged things together to add to the documentation package that GHC builds. That may be the wrong place, but it kinda works anyway. This script gets you much of the way there (with some unfortunate line wrapping at the end that you'd have to fix). Of course, the script does more than just build haddock; and there are several other quirks here to that were needed to get random stuff to work for some packages, and unfortunately there are a number of packages for which it seems that 'runhaskell Setup haddock' just doesn't work at all due to use of features in the source that haddock can't parse. What it doesn't do is fix up the links to contents and index from the other packages so that they point back to the right place. -- begin attached script -- #!/bin/sh ghcver=`ls -d /usr/local/lib/ghc-* | sort` ghcver=`expr match "$ghcver" '.*\(ghc-6.7.[0-9]*\)'` sudo rm /usr/local/lib/${ghcver}/share sudo ln -s /usr/local/share /usr/local/lib/${ghcver}/share sudo cp ../ghc/libraries/libraries-*.txt /usr/local/share/ghc/doc/html for ln in `cat packages.list` do d=${ln:0:1} p=${ln:1} echo =============================================================== echo == BUILDING: $p echo =============================================================== echo $d $p cd $p || exit 1 if [ -d _darcs ] then darcs pull || exit 1 fi if [ -f configure.in -o -f configure.ac ] then autoreconf || exit 1 fi if [ -f Setup.hs -o -f Setup.lhs ] then runhaskell Setup clean || exit 1 runhaskell Setup configure || exit 1 runhaskell Setup build || exit 1 if [ $d = "+" ] then runhaskell Setup haddock --html-location=/usr/local/share/ghc \ || exit 1 fi sudo runhaskell Setup install || exit 1 elif [ -f Makefile -o -f Makefile.in -o -f Makefile.am ] then if [ $d = "+" ] then echo "Don't know how to run haddock" exit 1 fi make distclean || true ./configure || exit 1 make || exit 1 sudo make install || exit 1 else echo "Don't know how to make $p" exit 1 fi cd .. done ls /usr/local/share/*/doc/html/*/haddock.css \ | grep -v '/usr/local/share/ghc' \ | sed 's/\(\/usr\/local\/share\/.*\/doc\/html\/\([^/]*\)\) \/haddock.css/cp -r \1 \/usr\/local\/share\/ghc\/doc\/html\/\2 ; echo \2
\/usr\/local\/share\/ghc\/doc\/html\/\2\/prologue.txt/' \ | sudo /bin/sh ls ../ghc/libraries/*/prologue.txt \ | sed 's/\(\.\.\/ghc\/libraries\/\([^\/]*\)\/prologue.txt\)/cp \1 \/usr\/local\/share\/ghc\/doc\/html\/\2/' \ | sudo /bin/sh cd /usr/local/share/ghc/doc/html sudo ./gen_contents_index
-- Chris Smith
participants (2)
-
Chris Smith
-
Duncan Coutts