假设我有下面的类。
class Foo
# I want the following to appear as-is in my documentation, not as an anchor tag.
#
# http://www.google.com/
#
def bar
puts "bar"
end
end然后我通过rdoc运行它。
$ rdoc foo.rb
它会生成以下代码:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
<a href="http://www.google.com">www.google.com</a>/
</p>
</div>我想让它生成类似这样的东西:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
http://www.google.com/
</p>
</div>实现这一目标的最佳方法是什么?
发布于 2011-01-13 11:11:41
步骤1
确保您使用的是:
ruby 1.9.2
rdoc 2.5.8步骤2
逃离它,你应该会好起来的。
class Foo
# I want the following to appear as-is in my documentation, not as an anchor tag.
#
# \http://www.google.com/
#
def bar
puts "bar"
end
end输出:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
http://www.google.com/
</p>
</div>https://stackoverflow.com/questions/4676167
复制相似问题