getting cabal to pass more info to haddock

Conal Elliott conal at conal.net
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=
http://darcs.haskell.org/packages/TV"
--haddock-arg='--source-module=src/%{MODULE/.//}.html'
--haddock-arg='--source-entity=src/%{MODULE/.//}.html#%{NAME}'

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 (http://www.cs.york.ac.uk/fp/darcs/hscolour):

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

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.
colorPrep:
    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.

Comments?

     - Conal

On 1/7/07, Duncan Coutts <duncan.coutts at worc.ox.ac.uk> 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 haskell.org mailing list.
>
> Duncan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20070108/3ade1839/attachment.htm


More information about the Libraries mailing list