[Haskell-cafe] Monospace code in Haddock

Niklas Hambüchen mail at nh2.me
Thu Sep 6 00:54:32 CEST 2012


You are right, if I escape as you describe, it works.

However, all the makes it quite hard to read in code, and as people
often read the code when dealing with Haskell, I will probably stick
with the non-inline approach. That also gives a nice blue highlighting
in haddocks in addition to the monospace.

On 05/09/12 21:29, Simon Hengel wrote:
> On Wed, Sep 05, 2012 at 09:11:47PM +0100, Niklas Hambüchen wrote:
>> When you write:
>>
>> -- | This function returns the string @hello@
>>
>> and you have a function called hello in scope, haddock will hyperlink
>> the the above hello to that function, which is confusing if your
>> monospace string has actually nothing to do with that function.
>>
>> In other words: Haddock always links to your functions in inline
>> monospaced text, and you can't turn that off.
>>
>> -- | Gives you @\<span\>hello\</span\>@
>>
>> will therefore link to functions 'span' and 'hello' if they exist.
> 
> As far as I know Haddock markup is interpreted withing @-blocks.  So if
> you write @`foo`@ it will get linked, but if you just write @foo@ it
> should not be linked.  If you write @\`foo`@ it should again not be
> linked.  It may be awkward at times, but I think you should be able to
> achieve what you want, no?
> 
> Please give a self-contained minimal example that illustrates your
> issue, if this still does not help.
> 
> Cheers,
> Simon
> 



More information about the Haskell-Cafe mailing list