When linking to a URL, one can provide a label that specifies what the reader will see; for example, <http://www.haskell.org haskell>
will have "haskell" for the link text. Unfortunately the documentation does not provide an obvious way to label links to anchors; the link "Data.FooBar#foo" will have "Data.FooBar" for the link text so that it is not obvious to the reader that this link is going to an anchor.
So my question is: is there a trick to label links to anchors in haddock, or is this impossible?
The link text is used as a descriptive text for the URL, if the output format supports it. Haddock supports Markdown syntax for inline images. This resembles the syntax for links, but starts with an exclamation mark.
All the usual Haddock Markup is valid in this comment. Haddock produces interface documentation that lists only the entities actually exported by the module. If there is no export list then all entities defined by the module are exported.
The annotations are purely optional: if there are no annotations, Haddock will just generate documentation that contains the type signatures, data type declarations, and class declarations exported by each of the modules being processed.
Some people like to write their documentation after the declaration; this is possible in Haddock too: Since Haddock uses the GHC API internally, it can infer types for top-level functions without type signatures.
This is now https://github.com/haskell/haddock/issues/262 (submitted by OP).
As I write this, it is open and has not been commented on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With