Integrating Cabal, Haddock, HsColour

Roberto Zunino zunino at
Sat Apr 21 16:33:54 EDT 2007

I've just extended Cabal so to generate docs with links to highlighted
sources. Now

./Setup configure
./Setup haddock --link-to-hscolour
./Setup hscolour --css my_own_stylesheet.css

generates HTML as this one: (run on Cabal itself)

Click on the "Source" links on the right. You will be sent to the exact
line. The whole Cabal docs+sources are online. Colours have been chosen
to match my emacs configuration :-P .

This relies on a couple of minor tweaks to Haddock and HsColour which I
darcs-sent this morning to the authors.

Comments are welcome.

- Is this worth including in the next Cabal version?
- Are the options above good choices?
- Is the directory tree OK? Currently Haddock creates (under dist/doc/html)


while ./Setup hscolour adds (also under dist/doc/html)


(lib is the package name, exeN are the targets of the other stanzas in
the .cabal file)

This is so that Haddock can use relative links to sources.

- Currently, you can run ./Setup haddock and ./Setup hscolour in any
order, and they work. You can run haddock without hscolour, and vice
versa. Links will be broken only if you pass --link-to-hscolour and do
not run hscolour.

Should I instead merge these subcommands so to have a single ./Setup
haddock --hscolour running everything?


More information about the Libraries mailing list