[Haskell-cafe] link to section heading in Haddock

Simon Hengel sol at typeful.net
Sat Jun 9 10:07:57 CEST 2012


> After glancing through the haddock documentation and some googling, I
> can't tell if there's a supported
> way to link to a section heading in haddock documentation. Is there?

There are several things that could be of interest.

 - There is support for named anchors [1].  I guess this is your best
   bet for now.

   You could e.g. use

       "Foo#g:1"

   To link to the first section of module Foo.  Disadvantages:

     (a) the id is not stable, it changes when you add new sections
         before that section

     (b) you can't decide on the link text, it is always the module name

   If it is ok for you to just link to some portion of text instead of
   the section heading, you can insert a named anchor (e.g. #foobar#)
   and use that (e.g. "Foo#foobar").  This solves (a), but not (b).


 - There is support for "named links [2].  This is already implemented,
   not sure when it will hit the road.

 - There is a ticket for exactly what you are asking for [3].  But no
   work has been done on that yet.

Cheers,
Simon

[1] http://www.haskell.org/haddock/doc/html/ch03s08.html#id566440
[2] http://trac.haskell.org/haddock/ticket/190
[3] http://trac.haskell.org/haddock/ticket/193



More information about the Haskell-Cafe mailing list