Re: Integrating Cabal, Haddock, HsColour

Roberto Zunino wrote:
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....
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?
Looks really nice! (BTW, cabal-devel@haskell.org is a better place to discuss Cabal improvements). I'm happy for it to go in.
- Are the options above good choices?
I'd make 'Setup haddock --hscolour' do both steps.
- Is the directory tree OK? Currently Haddock creates (under dist/doc/html)
Looks fine. Cheers, Simon

BTW, see also http://haskell.org/haskellwiki/Cabal-make, which automates
haddock & hscolour use and a few more things, via simple make files. I like
Cabal integration, so I'm all for Roberto's Cabal improvements.
- Conal
On 4/26/07, Simon Marlow
Roberto Zunino wrote:
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....
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?
Looks really nice! (BTW, cabal-devel@haskell.org is a better place to discuss Cabal improvements).
I'm happy for it to go in.
- Are the options above good choices?
I'd make 'Setup haddock --hscolour' do both steps.
- Is the directory tree OK? Currently Haddock creates (under dist/doc/html)
Looks fine.
Cheers, Simon _______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel

Simon Marlow wrote:
Looks really nice! (BTW, cabal-devel@haskell.org is a better place to discuss Cabal improvements).
Thanks! (I didn't find the cabal-devel list because http://www.haskell.org/cabal/ only mentions the libraries list.)
I'm happy for it to go in.
Does this imply the my Haddock patch for %{LINE} I sent you some time ago is also in? ;-)
I'd make 'Setup haddock --hscolour' do both steps.
Ok, I'm doing this. Zun.

Here's my final proposal. If everything is fine, I'll write the docs and submit the patch. New options: ** configure --with-hscolour=PATH give the path to hscolour --hscolour-args=ARGS give the args to hscolour ** haddock --executables Run Haddock for Executables targets --hscolour[=PATH] Also run hscolour (using PATH as the stylesheet, if any) ** hscolour --executables Run hscolour for Executables targets --css=PATH Use a cascading style sheet The --executables flag makes the doc-generating process to run for all stanzas in the .cabal file, i.e. for generating docs for "executable" pakages (Current patch also fixes related bug #102). Note the --css flag to hscolour. This is very much needed: hscolour expects the CSS file to be copied in the right directory, so either Cabal or the user has to copy the CSS file. Very often, if not always, you want to pass this flag to ./Setup hscolour, so that Cabal does it for you. Related to the above, ./Setup haddock --hscolour can take the PATH to the CSS file. I'm not particulary happy about this, because it feels a bit ad-hoc w.r.t. having a --with-hscolour-flags=[--css=...] , but the latter seemed overkill to me. Zun.

On Sun, 2007-05-06 at 19:16 +0200, Roberto Zunino wrote:
Simon Marlow wrote:
Looks really nice! (BTW, cabal-devel@haskell.org is a better place to discuss Cabal improvements).
Thanks! (I didn't find the cabal-devel list because http://www.haskell.org/cabal/ only mentions the libraries list.)
Good point. I've added a link. Duncan
participants (4)
-
Conal Elliott
-
Duncan Coutts
-
Roberto Zunino
-
Simon Marlow