Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yard, How to include image to documentation?

Tags:

ruby

yard

I want to include image in yard-genereted documentation, but can't find anywhere how to do this... Does anyone know how to do this?

like image 841
Adrian Serafin Avatar asked May 08 '11 15:05

Adrian Serafin


2 Answers

You can just add <img /> tag to your documentation:

 # Blah-blah 
 # 
 # <img src=img/1.png />
 # @param [String] blah
 # @return [String] blah
 def foo(bar) 

 end
like image 167
Vasiliy Ermolovich Avatar answered Oct 18 '22 07:10

Vasiliy Ermolovich


Use rdoc-image: links:

# Gets foo.
#
# rdoc-image:img/1.png
def foo(bar)
  "foo"
end

is rendered by YARD into

<p>Gets foo.</p>
<p><img src="img/1.png"></p>

The rdoc-images: also works in standalone *.rdoc files.

like image 20
Franklin Yu Avatar answered Oct 18 '22 07:10

Franklin Yu