--- Begin Message ---
Hi Isaac,

I'm attaching a cabal patch, which adds two new haddock flags.  One is
--haddock-arg, as described below, and the other is --no-use-packages, which
along with --haddock-arg, lets me pass haddock the --read-interface flags
without having them overriden by --use-package flags.  With these changes,
and a "cabal-make" include file for makefile, I'm getting haddock docs I'm
delighted with, including web-based links for other libraries, links to
hscolour'd sources, and links to "user comments" pages on the haskell wiki.
My three announced library releases use cabal-make, which I will release as
soon as the required patches are in Cabal (the attached patch, plus a
solution to -optP-P & haddock versions).

Please let me know whether this patch comes through, and if there's anything
else you'd like me to do to facilitate integration of the patch.

As a teaser, see http://darcs.haskell.org/packages/DeepArrow/Makefile, which
yielded the docs at http://darcs.haskell.org/packages/TV/doc/html/ .

Cheers,  - Conal

On 1/8/07, Conal Elliott <[EMAIL PROTECTED]> wrote:

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 haddockoptions, 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 <[EMAIL PROTECTED]> 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@haskell.org mailing list.
>
> Duncan
>
>

Attachment: haddock-flags-conal-patch
Description: Binary data


--- End Message ---
_______________________________________________
cabal-devel mailing list
cabal-devel@haskell.org
http://www.haskell.org/mailman/listinfo/cabal-devel

Reply via email to