[Haskell-cafe] Re: [Hs-Generics] how to automatically create and install documentations of a package?

Michael Shulman shulman at ugcs.caltech.edu
Sun Sep 27 23:36:11 EDT 2009


Andy Gimblett wrote:
>>> Is there a way to make it automatically update a single contents page
>>> with links to the documentation of all installed packages?
>>
>> See:
>>  http://thread.gmane.org/gmane.comp.lang.haskell.cafe/53531/focus=53560
>>  http://thread.gmane.org/gmane.comp.lang.haskell.cafe/53531/focus=53572
>
> Seeing this today (I'm catching up on haskell-cafe!) made me want this
> too, so I rolled my own.

Thanks!  Actually, this looks like maybe what I really wanted:

http://hackage.haskell.org/trac/hackage/ticket/516

I'll probably keep using my script for now, though, until a new version
of cabal is released with doc-index-file.  I've copied my little script
below in case anyone else wants a lightweight solution.

Mike


#!/bin/bash

# This script, when run in a directory containing subdirectories of
# the form pkg-1.1.1/html with haddock documentation, builds a master
# table of contents for all this documentation, including all the
# system-installed libraries from SYSDOCPATH.

SYSDOCPATH=/usr/share/doc/ghc6-doc/libraries

args=""

# Skip the 'ghc' package, which has a lot of packages we don't care about
for dir in $(find $SYSDOCPATH -type d -path '*libraries/*' -and -not
-name 'ghc'); do
    pushd $dir >/dev/null
    for thing in $(find . -name '*.haddock'); do
        args="$args -i $dir,$dir/$thing"
    done
    popd >/dev/null
done

for dir in $(find . -type d -name 'html'); do
    pushd $dir >/dev/null
    for thing in $(find . -name '*.haddock'); do
        args="$args -i $dir,$dir/$thing"
    done
    popd >/dev/null
done

haddock --gen-contents $args


More information about the Haskell-Cafe mailing list