Integrating Cabal, Haddock, HsColour

Roberto Zunino zunino at di.unipi.it
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)

http://www.di.unipi.it/~zunino/tmp/dist/doc/html/Cabal/Distribution-Program.html#v%3AwithProgramFlag

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)

lib/Module.html
lib/Module-SubMod.html
lib/exe1/...
lib/exe2/...

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

lib/src/Module.html
lib/src/Module-Submod.html
lib/src/hscolour.css
lib/exe1/src/...
lib/exe2/src/...

(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?

Zun.


More information about the Libraries mailing list