2009-08-18 32 views
4

我想在我的YARD文檔中創建一些鏈接。我可以得到一個HTTP鏈接:如何在YARD文檔中創建任意鏈接?

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

呈現爲

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

但電子郵件鏈接:

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

給我一個警告:

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

,並呈現爲

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

我嘗試了常規的RDoc語法鏈接:

bugs[mailto:[email protected]] 

但YARD似乎忽略這一點。有誰知道更可靠的語法?

回答

3

挖掘到Yard的代碼示出了問題:在 gems/yard-0.2.3.5/lib/yard存在線(73):

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

不允許mailto鏈接。你可以用

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

取代這條線,也將努力爲你想...還不夠完美,但這是我的一切現在。

+2

這正是我所做的這個叉:http://github.com/gcnovus/yard/commit/5a977b03b8f713588703255806853ca492090a56 – 2009-08-20 12:01:13

3

0.2.3.6都會有這樣的支持

相關問題