getting cabal to pass more info to haddock

Conal Elliott conal at
Mon Jan 8 21:19:33 EST 2007

I gave Cabal a --haddock-arg flag (use one per haddock argument), so now I
can have a make rule like:

haddock: config
    ./setup haddock --haddock-arg="--source-base="

Works fine so far.  I'd like feedback on the interface before darcs-sending
the patch.

I started with a --haddock-args flag to hold any number of haddock options,
but the arguments then got passed as a single argument to haddock, which
then couldn't make sense of them.  So instead, you use one --haddock-arg
flag per haddock flag.

I'd also like some suggestions on the following:

For syntax coloring and anchoring, I use this rule, gleaned Malcolm's
hscolour page (

    for file in $(sources); \
      do HsColour -anchorHTML $$file >$(doc)/`dirname $$file`/`basename
$$file .hs`.html; \

It's a pain, though, as I have to make sure the required directories are all
present.  For that purpose, I have this rule:

# Make the doc directories we need.
    if [ ! -d $(doc)/src/Graphics/UI/TV ]; then mkdir
$(doc)/src{,/Graphics{,/UI{,/TV}}}; fi

And I have to remember to do "make colorPrep" before "make hscolour".  Not
very convenient especially if my package's module hierarchy branches.


     - Conal

On 1/7/07, Duncan Coutts <duncan.coutts at> wrote:
> On Sun, 2007-01-07 at 10:42 -0800, Conal Elliott wrote:
> > I want Cabal to pass the source-module and source-entity flags to
> > haddock.  I can probably figure out how to add these flags into the
> > Cabal source (following the example of --hoogle), but I wonder if
> > there's a better way.  Any suggestions?
> runhaskell Setup.hs configure --haddock-args="--source-module=..."
> > If source mod, is there a process for me to follow?  To whom would I
> > send the patch?
> If you use 'darcs send' to send in your patch then it should just work,
> the address has already been set. If darcs send doesn't work for you (eg
> if you've not got local mail working) then you can email it to the
> cabal-devel at mailing list.
> Duncan
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Libraries mailing list