[Haskell-cafe] Linking to anchors in Haddock

Sven Panne svenpanne at gmail.com
Thu Sep 17 19:09:52 UTC 2015


Haddock offers a way to add anchors to the documentation and to link to
them, see
https://www.haskell.org/haddock/doc/html/ch03s08.html#idm140354810720016.
I've got 2 problems with that:

   * A link to an anchor "Foo.Bar#Baz" is always rendered with the text
"Foo.Bar" in the HTML backend. Is there a way to change that? With the HTML
backend I actually want something like:

        <a href="path-to-Foo.Bar#Baz">My own link text</a>

   * Using relative hype [My own link text](Foo-Bar.html#Baz) instead has
problems, too: The "Foo-Bar.html" part is fragile and depends on Haddock
flags. Furthermore, when using the LaTeX backend, the resulting LaTeX code
is broken (the '#' needs an escaping backslash).

So is there a non-fragile way working with several backends which makes it
possible to specify the link text? Staring at the Haddock docs and the
Haddock source code didn't help, and several experiments gave no clue,
either. :-/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150917/8d2daab3/attachment.html>


More information about the Haskell-Cafe mailing list