Yard, How do I include an image in the documentation?

I want to include an image in binary documentation, but cannot find anywhere how to do it ... Does anyone know how to do this?

+6
source share
3 answers

You can simply add the <img /> to your documentation:

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

Depending on the layout format, you may need to use a different mechanism. For example, if you use Markdown, the syntax is ![Alt text](/path/to/img.jpg) . In RDoc, the img tag should work, but you can check if they have added special markup syntax for this. Note that RDoc probably (not sure) doesn't like XHTML, you should use endlessly /.

0
source

Use rdoc-image: links:

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

displayed yard in

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

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

0
source

Source: https://habr.com/ru/post/887562/


All Articles