Using Ruby's Yard doc tool, can I configure Yard to *not* put methods in alphabetical order?

StackOverflow https://stackoverflow.com/questions/8875555

  •  28-10-2019
  •  | 
  •  

Вопрос

I'm developing a Ruby programming tutorial which I'd like to document with Yard. By default, Yard puts all methods in a module/class into alphabetical order. However, since the methods in each module in the tutorial build upon one another, I'd like to keep them in the order I wrote them.

Is there a way to configure Yard to not put methods in alphabetical order?

Это было полезно?

Решение

The default template does not provide an option for leaving the method names unsorted.

Your options are to create a custom template or patch the default one.

If it helps the line that is sorting the methods is: https://github.com/lsegal/yard/blob/master/templates/default/module/setup.rb#L39

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top