如何使用 Yard for Rails 视图生成文档?
我刚刚开始使用 Yard 生成我的文档,虽然它非常适合我的模型和控制器,但我似乎无法让它为视图生成任何内容,
我尝试了各种不同的方法来让它工作。目前,我已经设置了一个 rake 任务来生成看起来像这样的文档
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'app/**/*.rb', 'app/views/**/*.erb']
t.options = []
end
我相信,最后一条路径应该让它包含我的视图,但是当我查看文档时,没有提到任何这些文件全部。有什么想法吗?
干杯
I have just started using Yard to generate my docs and whilst it works great for my models and controllers, I can't seem to get it to generate anything for the views
I've tried a variety of different ways to get it to work. Currently I've set up a rake task to generate the docs that looks something like this
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'app/**/*.rb', 'app/views/**/*.erb']
t.options = []
end
The last path there, I believe, should get it to include my views but when I look at the docs, there's no mention of any of these files at all. Any ideas why?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模板文件不应包含 Ruby 方法或业务逻辑。您想生成什么类型的文档?
Template files are not expected to contain Ruby methods or business logic. What kind of documentation would you like to generate?