All Projects → ranjitjhala → haddock-annot

ranjitjhala / haddock-annot

Licence: other
Modified versions of Cabal & Haddock for rendering Annotated HTML with Mouseover Types.

Programming Languages

haskell
3896 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
Logos
282 projects
Makefile
30231 projects

Modified version of Haddock/Cabal to generate HTML documentation with mouse-over types. See:

or in particular,

for examples.

Status

Ideally, this would be patched into the regular haddock distribution but for an unfortunate dependency on the syb package. See:

http://bb10.com/haskell-cabal-devel/2011-06/msg00004.html

Have not found the time to remove the dependency on syb -- should be quite easy, so it would be great if someone could do that!

Build

Build and install cabal and haddock (from these sources) in the usual way (the current hscolour supports annotations directly.)

Usage: Cabal Packages

To use generate annotated html source (with mouseover types)

cabal haddock --hyperlink-source --annot --hscolour-css=path/to/css

To generate the HTML for a package in one shot

cabal haddock --hyperlink-source --annot

but you have to copy hscolour.css over to the destination html directory.

To use a particular annot.txt to generate files

cabal hscolour --annot=dist/doc/html/hscolour/annot.txt  --css=hscolour.css

To use a specific haddock binary

cabal haddock -v3 --hyperlink-source --haddock-options="--annot=annot.txt" --with-haddock=/home/rjhala/.cabal/bin/haddock 

Usage: Single Files

To work with a single .hs file and generate random.txt (with the annots)

haddock Misc.hs --annot=random.txt

You can then generate the html by

hscolour -acss=random.txt Misc.hs > goo.html

TODO

  • wierd bug with --executables (off by one path -- see cabal-install case)

  • remove the dependency on syb to facilitate merging into mainline haddock

To generate annot.txt and render separately with hscolour

cabal haddock  --hyperlink-source --haddock-options="--annot=annot.txt"


cabal hscolour --hscolour-options="-acss=annot.txt" --hscolour-css=/home/jhala/research/haskellery/hscolour-1.18/hscolour.css 
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].