Search code examples
rubyrdocyard

Does Ruby Yard have a feature comparable to RDoc :include: tag?


RDoc has the :include: tag (see the bottom of this page) that will take in an arbitrary text file and format as if it was indented wherever the include begins. This is a great way to pull in source code for documentation examples.

Does Yard have a similar tag or feature?


Solution

  • Currently YARD only supports embedding documentation from other object docstrings in the form:

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

    File inclusion was vaguely planned but it was never really requested before, so it wasn't high priority. If you want to open an issue on http://github.com/lsegal/yard/issues -- we can make sure it gets tracked and added for the upcoming 0.7.0 release.