Rails 大家都用什么制作文档

sforce100 · 2013年01月05日 · 最后由 doitian 回复于 2013年01月05日 · 1998 次阅读

用的是 mongoid..rdoc 构造文档时 model 中的 field 都没生成出来,这是怎么回事呢??更别说 model 的继承,yardoc 好点..继承关系都出来了,但是好像不能脱机。但是 field 都没出来

yardoc 不是生成文件到 doc 下了吗。mongoid 只需要加个宏让 yardoc 给 field 生成注释就行了。

http://rubydoc.info/docs/yard/file/docs/GettingStarted.md#Macros

attach 到 field 方法上,(类型是个 Hash,可能不好提取)

# @!macro [attach] mongoid.field
# @return [Object] the $1 $0 of the post
property :title, :type => String

#1 楼 @doitian 生成

Instance Method Summary (collapse)

- (Object) content

this is the content of correct. 带 Instance Method Summary 这样提示。。感觉怪怪的

那就用 attribute

# @!macro [attach] monoid.field
# @!attribute $1
#   @return [Object]
需要 登录 后方可回复, 如果你还没有账号请 注册新账号