I am writing documentation for a library using haddock, and, for reasons that are not really necessary to explain, I need to include a little code block in my documentation that looks like:
z(<>)
Importantly there can be no space between z
and (<>)
. It may be a bit esoteric but
z (<>)
would make my documentation incorrect, even if it is more stylistically correct.
Now I believe that hyperlinks to both z
and (<>)
would be helpful. Neither has a very informative name, so a link that helps people remember their definitions and purpose is nice.
So my code without the hyperlinks looks like:
@z(<>)@
And to add hyperlinks I just use single quotes:
@'z''(<>)'@
Except that doesn't work, haddock sees 'z''
and thinks that I mean to link z'
(a function that does exist in my module), and then just leaves the rest alone. The rendered output looks like
z'(<>)'
Now as an experiment I deleted the definition of z'
, however the only difference this makes is that the link to z'
goes away. The raw text remains the same. The next thing I tried was ditching @
s altogether and did
'z''(<>)'
Which also created a hyperlink to z'
and left the rest untouched, the same problem as earlier except now nothing is in a code block.
How can I make a code block that links two functions without a space between?