haddock suggestion -- %{FILE}

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Jan 9 04:45:32 EST 2007


(oops, I meant to reply to the list as well as to Conal)

On Mon, 2007-01-08 at 22:26 -0800, Conal Elliott wrote:
> I pre-process my source code before handing to haddock.  The %{FILE}
> directive for --source-comments etc uses the actual preprocessed file
> name rather than the the original, which is not what I want.  Is this
> just an oversight?  

If your pre-processor uses the C or Haskell line pragmas then haddock
(as of version 0.8) will know the original file name and the links to
source will work (I've tested it).

So the question is, what pre-processor are you using, and how can we
persuade it to emit C or Haskell line pragmas. cpp can do it, as can
cpphs, hsc2hs, c2hs, alex, happy etc.

It may be that they don't all do it by default at the moment, or that
Cabal doesn't instruct them to do it by default. Previous versions of
haddock didn't cope with C style line pragmas iirc so I think they used
to be disabled for cpp/cpphs.

Duncan




More information about the Libraries mailing list