我试图使用 yard
记录一些 Ruby 代码,尽管我所做的正是所描述的 here或 here
# @param [Integer] the number of trials (>= 0)
# @param [Float] success probability in each trial
def initialize(n, p)
# initialize...
end
虽然我仍然得到这个奇怪的错误
@param tag has unknown parameter name: the
@param tag has unknown parameter name: success
然后生成的 html 看起来很奇怪。我称 yard
为:
$ yard doc -m markdown
我做错了什么?
最佳答案
文档说@param 标签有格式
@param [Type] name description
并且您的行不包含参数名称(分别为 n 和 p)
关于ruby - 在院子里用@param 标签警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11311973/