views:

95

answers:

2

I'm trying to create some links in my YARD documentation. I can get an HTTP link:

# I like {http://stackoverflow.com Stackoverflow}

renders as

<p>I like <a href="http://stackoverflow.com"&gt;Stackoverflow&lt;/a&gt;&lt;/p&gt;

But an email link:

# You can email the {mailto:[email protected] bugs} list

gives me a warning:

[warn]: In file `':: Cannot resolve link to mailto:bugs@myprojectmailto:[email protected] from text:

and renders as

<p>You can email the <tt>bugs</tt> list</p>

I've tried the regular RDoc syntax for links:

bugs[mailto:[email protected]]

but YARD seems to ignore that. Does anyone know of a more reliable syntax?

+2  A: 

Digging into YARD's code shows the problem: in gems/yard-0.2.3.5/lib/yard there is the line (73):

if name.include?("://")

which doesn't allow mailto links. You can replace this line with

if name.include?("://") or name.include?("mailto:")

and it will work as you want... not exactly ideal, but that's all I've got right now.

Peter
That's exactly what I did on this fork: http://github.com/gcnovus/yard/commit/5a977b03b8f713588703255806853ca492090a56
James A. Rosen
A: 

0.2.3.6 will have this support

Loren Segal