3
votes

I have inherited a bunch of Ruby code with rdoc comments, but many of the options and attributes are multi-line, such as:

# +param+:: Here is a parameter with a really long description
#  that won't fit in one line

The end result is really hard to read docs using rdoc, sdoc, or yard. Each displays the second line in a different way. Am I missing something? Is there some way to retain line wraps, but make the generated documentation come out correct?

1
it seems not possible - ribamar

1 Answers

1
votes

In YARD it's possible to continue the line by simply adding another comment line without any special annotation, just indent of at least two characters. You can find it documented here: https://www.rubydoc.info/gems/yard/file/docs/Tags.md

For example this code below:

# class description
class Test
  # @param [String] one this parameter has an astonishingly
  #  long description
  def method(one)
    nil
  end
end

renders as

YARD render