haddock icon indicating copy to clipboard operation
haddock copied to clipboard

Links to sections

Open ghc-mirror opened this issue 11 years ago • 3 comments

Original reporter: sol@

It would be nice if we could link to certain sections withing a document.

Example:

module Foo (
-- * Foo
..
..
-- * Bar
-- | Read more in [Foo]
..
..
) where

As a precondition, we would need a way to address section in a unique manner.

This is somewhat related to #190 (both, #190 and this, require syntax extensions for new kinds of links).

ghc-mirror avatar May 08 '14 20:05 ghc-mirror

Original reporter: sol@

We already almost have this (3.8.12. Anchors), but from what I can tell, it's broken. Creating anchors with #label# still works, but module names in angel brackets are not treated any special (contrary to what the documentation claims).

ghc-mirror avatar May 08 '14 20:05 ghc-mirror

I agree that;

module names in angel brackets are not treated any special (contrary to what the documentation claims).

If I write <Flight.Kml#range fixesLength> or <Flight.Kml\#range fixesLength> the link is to;

/doc/html/flight-kml/Flight.Kml#range

When the link that I'm trying to generate is;

/doc/html/flight-kml/Flight-Kml.html#range.

Here's the relevant section of the docs;

To link to an anchor from elsewhere, use the syntax "module#label" where module is the module name containing the anchor, and label is the anchor label. The module does not have to be local, it can be imported via an interface. Please note that in Haddock versions 2.13.x and earlier, the syntax was "module#label". It is considered deprecated and will be removed in the future.

philderbeast avatar Jun 28 '18 20:06 philderbeast

Any thoughts on this? Bit by it today.

shlevy avatar Sep 28 '22 12:09 shlevy