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?
yard, How to include image to documentation?
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
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.
Depending on your markup format you may have to use another mechanism. For instance, if you use Markdown, the syntax is ![Alt text](/path/to/img.jpg)
. In RDoc, an img tag should work, but you can check if they have added a special markup syntax for this. Note that RDoc probably (not sure) doesn't like XHTML, you should use with no ending /.
© 2022 - 2024 — McMap. All rights reserved.
<img src='img/1.png' />
– Voluntarism