【问题标题】:Does Ruby Yard have a feature comparable to RDoc :include: tag?Ruby Yard 是否具有可与 RDoc :include: 标记相媲美的功能?
【发布时间】:2011-01-12 04:39:17
【问题描述】:

RDoc 具有 :include: 标记(参见this page 的底部),它将接收任意文本文件和格式,就好像它在包含开始的地方缩进一样。这是为文档示例提取源代码的好方法。

Yard 是否有类似的标签或功能?

【问题讨论】:

    标签: ruby rdoc yard


    【解决方案1】:

    目前 YARD 仅支持在表单中嵌入来自其他对象文档字符串的文档:

    class Foo
      # Docstring here
      def method; end
    
      # Here is some more docs and {include:Foo#method}
      def bar; end
    end
    

    文件包含的计划很模糊,但之前从未真正请求过,所以它不是高优先级。如果您想在 http://github.com/lsegal/yard/issues 上打开问题 - 我们可以确保它被跟踪并添加到即将发布的 0.7.0 版本中。

    【讨论】:

    • * 10 年后 * 我在现代 RubyMine 中尝试过 sn-p,它似乎完全忽略了 {include} 标签。它呈现为纯文本,没有“Docstring here”注入
    猜你喜欢
    • 2020-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-11
    • 2023-03-03
    • 1970-01-01
    • 2022-11-15
    相关资源
    最近更新 更多