5

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">Stackoverflow</a></p>

But an email link:

# You can email the {mailto:bugs@myproject.com bugs} list

gives me a warning:

[warn]: In file `':: Cannot resolve link to mailto:bugs@myprojectmailto:bugs@myproject.com 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:bugs@myproject.com]

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

Rudu
  • 15,682
  • 4
  • 47
  • 63
James A. Rosen
  • 64,193
  • 61
  • 179
  • 261

2 Answers2

3

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
  • 127,331
  • 53
  • 180
  • 211
3

0.2.3.6 will have this support

Loren Segal
  • 3,251
  • 1
  • 28
  • 29